Skip to content

Instantly share code, notes, and snippets.

@geelen
Forked from ryan-allen/first-big-wtf-in-months.rb
Created September 2, 2010 06:55
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 geelen/561976 to your computer and use it in GitHub Desktop.
Save geelen/561976 to your computer and use it in GitHub Desktop.
irb(main):001:0> a = lambda { b.call }
=> #<Proc:0x00000001038c8af8@(irb):1>
irb(main):002:0> b = lambda { :foo }
=> #<Proc:0x00000001038c3b20@(irb):2>
irb(main):003:0> a.call
NameError: undefined local variable or method `b' for #<Object:0x103fac888>
from (irb):1
from (irb):3:in `call'
from (irb):3
irb(main):004:0> c = lambda { b.call }
=> #<Proc:0x00000001038bb2e0@(irb):4>
irb(main):005:0> c.call
=> :foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment