Created
November 25, 2009 17:53
-
-
Save scashin133/242904 to your computer and use it in GitHub Desktop.
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
def foo | |
f = Proc.new { return "return from foo from inside proc" } | |
f.call # control leaves foo here | |
return "return from foo" | |
end | |
def bar | |
f = lambda { return "return from lambda" } | |
f.call # control does not leave bar here | |
return "return from bar" | |
end | |
puts foo # prints "return from foo from inside proc" | |
puts bar # prints "return from bar" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment