Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created November 16, 2011 09:36
Show Gist options
  • Save Shinpeim/1369676 to your computer and use it in GitHub Desktop.
Save Shinpeim/1369676 to your computer and use it in GitHub Desktop.
double_lambda = lambda {|x| return x * 2}
def double_fn(x)
return x * 2;
end
p double_lambda.call(4) #8
p double_fn(4) #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment