Majority of Ruby 2.0 syntaxes are backward-compatible with Ruby 1.9. Yet there is one tiny change in the way that Ruby 2.0 does lambda rocket that would break backward-compatability with Ruby 1.9. That is…a single space. Yes, you heard it correctly.
So, in Ruby 2.0, you could declare shorthand
->. Here is example:
The above code runs fine under 2.0 yet failed spectacularly with 1.9:
1 2 3 4 5 6 7
In order to fix this issue, we have to rid of the space between
Weird, isn’t it? At least you are aware of this discrepancy now.