Skip to content

Instantly share code, notes, and snippets.

@mach-kernel
Created September 18, 2015 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mach-kernel/1788a86a665cee3fbe9c to your computer and use it in GitHub Desktop.
Save mach-kernel/1788a86a665cee3fbe9c to your computer and use it in GitHub Desktop.
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