From: Christian Neukirchen Date: 2005-10-27T23:21:57+09:00 Subject: Re: Keeping the Sabbath (more thoughts on meta-coding) "Trans" writes: > Previously I entertained a Meta module, or using ObjectSpace for these > meta-coding commands. But thats a bit wordy. Today I thought about how > these specific commands are kind of sacred. Then I thought global vars > are kind of like that too. So: > > $id = lambda{ |obj| Kernel.instance_method(:object_id).bind(obj).call > } > $class = lambda{ |obj| Kernel.instance_method(:class).bind(obj).call > } > $dup = lambda{ |obj| Kernel.instance_method(:dup).bind(obj).call } > > It's concise and we avoid keywords and cluttering the object's method > namespace. > > You thoughts on "holy" commands? Let's redefine #bind and #call. }:-) > T. -- Christian Neukirchen http://chneukirchen.org