Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created July 30, 2012 19:18
Show Gist options
  • Save jasonLaster/3209316 to your computer and use it in GitHub Desktop.
Save jasonLaster/3209316 to your computer and use it in GitHub Desktop.
anonymous function fun
# why can a proc be passed to an instance_eval and not a lambda?
b = binding
b.instance_eval {@x = 5}
b.instance_eval &(proc {puts @x})
b.instance_eval &(lambda {puts @x})
@jasonLaster
Copy link
Author

b.instance_eval &(lambda {|b| puts @x})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment