Skip to content

Instantly share code, notes, and snippets.

@jacegu
Created March 14, 2013 14:18
Show Gist options
  • Save jacegu/5161683 to your computer and use it in GitHub Desktop.
Save jacegu/5161683 to your computer and use it in GitHub Desktop.
Weird behavior between ruby versions with ->{ } proc syntax. Any explanation?
#ruby 1.9.2-p320
BasicObject.new.instance_eval { ->{} }
#NoMethodError: undefined method `lambda' for #<BasicObject:0x007f97eb198590>
# from (irb):6:in `block in irb_binding'
# from (irb):6:in `instance_eval'
# from (irb):6
# from /Users/jacegu/.rbenv/versions/1.9.2-p320/bin/irb:12:in `<main>'
#ruby 1.9.3-p392
BasicObject.new.instance_eval { ->{} }
=> #<Proc:0x007f9f398ed7c8@(irb):1 (lambda)>
@gpg0
Copy link

gpg0 commented Mar 14, 2013

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