Created
June 25, 2014 03:24
-
-
Save brgnepal/80299aa64c1e20f0842c to your computer and use it in GitHub Desktop.
Lambda and Proc Return Behavior
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
def lambda_test | |
lam = lambda { return } | |
lam.call | |
puts "Hello world" | |
end | |
puts "Lambda Test : #{lambda_test }" | |
def proc_test | |
proc = Proc.new { return } | |
proc.call | |
puts "Hello world" | |
end | |
proc_test | |
puts "Proc Test : #{proc_test }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment