michaeljbishop / mulligan

Elegant, Ruby-ish Restartable Exceptions for Ruby (like Lisp's "Restarts")
http://michaeljbishop.github.io/mulligan/
MIT License
8 stars 0 forks source link

Mulligan should not fail on non-callcc rubies #12

Closed michaeljbishop closed 10 years ago

michaeljbishop commented 10 years ago

Right now, Mulligan will not compile on Rubinius or JRuby because they don't implement callcc. Create a version that will run in those rubies but disables recoveries. No code changes should be required for code that raises. Code that rescues should check for the presence of a recovery before calling it OR, wrap all recovery-invoking code in a block specifically designed to ignore mulligan on non-compliant platforms.

with_mulligans(e) do |e|
  e.recover ...
  e.recover ...
  e.recover ...
end
michaeljbishop commented 10 years ago

Closed with https://github.com/michaeljbishop/mulligan/commit/56b9bcaa1701f34e1dd9f2ee3c15c77591262ef1