On Oct 25, 2006, at 3:31 PM, Gavin Kistner wrote:

> From: Morton Goldberg [mailto:m_goldberg / ameritech.net]
>> I'd rather pass in a block. Is there a way to do that? Something  
>> like:
>>
>> <pseud-code>
>> module Kernel
>>     def tell(obj, &to_do)
>>        # what goes here?
>>     end
>> end
>>
>> tell Foo.new do
>>     report
>>     eat 'burger', 'fries'
>>     drink 'beer'
>>     be_merry
>> end
>> </pseud-code>
>
> def tell( obj, &to_do )
>   obj.instance_eval( &to_do )
> end
>
> class Foo
>   def say_hi
>     p "Hi!"
>   end
> end
>
> tell Foo.new do
>   say_hi
> end
> #=> "Hi!"

It's really that easy? Amazing! Ruby makes things so easy compared  
with the other languages I've used that I'm constantly inventing hard  
ways of doing what is too obvious for me to see.

Thanks for your help.

Regards, Morton