From: "Imobach González Sosa" Date: 2011-01-13T01:33:03+09:00 Subject: Deferring proc bindings Hi all, I'm re-joining to the ruby-talk mailing list and this time I hope I can get some spare time to read some threads :) BTW, here's my first question. It is about procs and scopes: my_proc = lambda { |arg1| puts arg1; puts user } AFAIK, arg1 is passed as a parameter (ie. when calling Proc#call) and user is taken from the scope where my_proc is declared. So, my question is: how could I do that 'user' was deferred until proc is called? def call_my_proc(&some_proc) user = 'me' some_proc.call("Hi, it's") end my_proc = lambda { |arg1| puts arg1; puts user } call_my_proc(&my_proc) # "Hi, it's me" I think I could do using eval with a string, but I'd like to solve in block-like form. Is that possible? Any ideas? Thank you in advance. -- Imobach González Sosa imobachgs at gmail dot com