Last active
December 20, 2015 22:49
-
-
Save keithrbennett/6208048 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
def foo_proc | |
puts 'proc 1' | |
proc { return }.call | |
puts 'proc 2' | |
end | |
def foo_block | |
puts 'block 1' | |
loop { return } | |
puts 'block 2' | |
end | |
def foo_lambda | |
puts 'lambda 1' | |
->(){ return }.call | |
puts 'lambda 2' | |
end | |
foo_proc | |
# proc 1 | |
foo_block | |
# block 1 | |
foo_lambda | |
# lambda 1 | |
# lambda 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment