Hi --

On Tue, 12 Dec 2006, J2M wrote:

>>> What made this sweet for me was turning the &block into a lambda let me
>>> return the result from the instance_eval to bar where other solutions
>>> kept them in scope of the &block.
>>
>> But the block *is* a lambda :-)  That's what the &block argument does:
>> it captures the code block in an object and assigns a variable to it.
>
> But without the lambda it is a raw proc that doesn't return the result
> of the method - from what I understand from page 344 of Pickaxe. I
> tried without and didn't get the result passed back from
> method_missing, but I will now test that again :-)

You may be right; I didn't demo it because I couldn't figure out
exactly what code I needed to add :-)  You may be hitting one of the
Proc/proc/lambda/block difference things.


David

-- 
Q. What's a good holiday present for the serious Rails developer?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
    aka The Ruby book for Rails developers!
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)