Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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