5 ms·
I wouldn't say corrupted, just different. I imagine there are many cases in which the different semantics are used intentionally. This is really not a huge is
by gunderson 18y ago
I wouldn't say corrupted, just different. I imagine there are many cases in which the different semantics are used intentionally.
This is really not a huge issue, b/c anyone who has worked with Ruby enough knows about it. It's mainly that the difference doesn't really make logical sense -- why would a "proc" behave differently from a "lambda"? Also note that:
lamba { foo }
means exactly the same as
proc { foo }
which is different than:
Proc.new { foo }
This sort of smells, but it wouldn't if there were a new keyword to represent the way Proc.new behaves... then everyone would flex their Ruby muscles by writing confusing hacks that utilized the behavior of StrongReturnProc.new ... :)
- raganwald 18y agoit wouldn't if there were a new keyword to represent the way Proc.new behaves My understanding is that there is a very good chance that Ruby 1.9 (when it stabilizes) will change the proc keyword to have Proc.new semantics instead of lambda semantics, for exactly the reason your give.