Created
September 18, 2015 20:07
-
-
Save mach-kernel/1788a86a665cee3fbe9c 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 calc2(a, b) | |
yield(a,b) | |
end | |
# this works | |
p calc2(5, 6) {|a,b| a+b} | |
# this works | |
calc2(5, 6) do |a, b| | |
p a + b | |
end | |
# this does not work | |
p calc2(5,6) do |a, b| | |
a + b | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment