Last active
December 29, 2015 11:39
-
-
Save headius/7665198 to your computer and use it in GitHub Desktop.
New behavior of return in blockified (using &) lambda in Ruby 2.1.
This file contains 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
system ~/projects/ruby $ ruby2.1 -e "def foo; bar &->{return}; puts :a; end; def bar; yield; puts :b; end; foo; puts :c" | |
b | |
a | |
c | |
system ~/projects/ruby $ ruby2.0.0 -e "def foo; bar &->{return}; puts :a; end; def bar; yield; puts :b; end; foo; puts :c" | |
c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment