On Thu, 24 Aug 2006, James Edward Gray II wrote:

> On Aug 23, 2006, at 3:13 PM, dblack / wobblini.net wrote:
>
>> # Sigh -- Matz, *please* can we have this? :-)
>> def singleton_class
>>   class << self; self; end
>> end

much better, imho, and used all over my own code is

   def singleton_class &b
     sc = class << self; self; end
     b ? sc.module_eval &b : sc
   end

obj = Object.new

obj.singleton_class{ def foo() 42 end }

2 cts.

-a
-- 
to foster inner awareness, introspection, and reasoning is more efficient than
meditation and prayer.
- h.h. the 14th dali lama