Experimental features withdrawn from Ruby 1.9
Here follows a list of experimental features that were at some point in Ruby 1.9 and were thus listed in the Ruby 1.9 changelog I maintain.
I will add things as I remember them or remove them from the changelog.
->() syntax for blocks
You could do things like
arr.each ->(x){ puts 2*x }
Note that the ->() syntax for lambdas still exists.
New constant lookup rules
Now constants were looked up in the following order:
- current class
- super classes except Object
- lexically enclosing classes/modules
- Object
The new rules entailed differences in dynamic constant lookups too:
class A
BAR = 1
def foo(&b); instance_eval(&b) end
end
a = A.new
a.foo { BAR } # => 1
vs. 1.8:
class A
BAR = 1
def foo(&b); instance_eval(&b) end
end
a = A.new
a.foo { BAR } # =>
# ~> -:7: uninitialized constant BAR (NameError)
# ~> from -:3:in `foo'
# ~> from -:7
See also ruby-talk:181646.
Referer
- 8 http://forum.ruby-portal.de/viewtopic.php?t=3642&start=15
- 6 http://forum.ruby-portal.de/viewtopic.php?t=3642&postdays=0&postorder=asc&start=15
- 4 http://forum.ruby-portal.de/viewtopic.php?p=36572
- 1 http://forum.ruby-portal.de/viewtopic.php?p=47727
- 1 http://forum.ruby-portal.de/viewtopic.php?t=7208
- 1 http://forum.ruby-portal.de/viewtopic.php?p=36628
- 1 http://forum.ruby-portal.de/viewtopic.php?p=47719
- 1 http://forum.ruby-portal.de/viewtopic.php?t=3642&postdays=0&postorder=asc&start=15&sid=3f4e94e602df14af5deb704f0bfe7134
- 1 http://pragdave.pragprog.com
- 1 http://forum.ruby-portal.de/viewtopic.php?p=47716
Keyword(s):[ruby] [1.9] [ruby2] [changelog]
References: