From: Joel VanderWerf Date: 2008-05-28T00:30:43+09:00 Subject: Re: OOP in Ruby? Robert Dober wrote: > I however believe it does, if you write a block in Ruby it is always > passed on to a method, let that be Kernel#proc, Enumerable#map or > whatever, that means that a Proc object referring to the block is > always accessible via either the prefixed &blk parameter in this > method or in case there is not &blk parameter and yield is used in the > method it still is accessible as Proc::new without parameters def foo p ObjectSpace.each_object(Proc){} end def bar(&bl) p ObjectSpace.each_object(Proc){} end GC.disable foo {} # ==> 59 foo {} # ==> 59 foo {} # ==> 59 bar {} # ==> 60 bar {} # ==> 61 bar {} # ==> 62 -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407