Created
December 2, 2010 14:03
-
-
Save tildedave/725337 to your computer and use it in GitHub Desktop.
from Andrew Kennedy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# scoping in ruby 1.8.7 | |
x = 0 | |
[1,2,3].each{|x| puts x} | |
puts x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ironcamel,
Are you aware that Ruby 1.9 is almost a total reimplementation of Ruby? You appear to think it was a minor update.
Internally, Ruby 1.9 has very little in common with Ruby 1.8. In terms of features; Ruby 1.9 adds some major new features and cleans up a few inconsistencies and bugs - one of those bugs being the block variable scoping pointed out in this gist. Nonetheless Ruby 1.9 aims to be more or less 95% backwards compatible with Ruby 1.8 - which it has achieved.
Major releases are allowed to have breaking changes. Ruby 1.9 is a major release, it has breaking changes. In terms of 'expectation' - there were expected to be breaking changes. Once again: It is a Major Release.
Get over it. Everyone else has.