From: ara.t.howard@... Date: 2007-01-04T09:48:21+09:00 Subject: Re: Little Things On Thu, 4 Jan 2007 dblack@wobblini.net wrote: >> hmmm. there is no way around this kind of thing unless the operation of >> sending a message to an object is removed from the object's interface. so >> we >> could have something like >> >> Pervasives.send obj, message, *args, &block >> >> here Pervasives is an object that cannot be changed - even by changing >> Object#send. >> >> this also allows >> >> Pervasives.object_id obj >> >> etc. >> >> thoughts? > > I'm afraid I'm lost. What's wrong with send, other than its > commonness as a name (which is dealt with by __send__)? If it's too > much trouble to explain, that's OK. so long as we have to rely on objects responding to certain methods certain constructs, such as those that meta-programming cut to, can be made difficult since the very methods we require to operate can be over-ridden. this is why we have __id__ __send__ are examples. by moving the essential methods outside of the object itself an into a frozen introspector Introspector.object_id obj we can elimnate this gotcha and this code class BlankSlate instance_methods.each{|m| remove_method unless m[/__/]} end can be reduced (and made more robust) to class BlankSlate instance_methods.each{|m| remove_method m} end make sense? -a -- if you find yourself slandering anybody, first imagine that your mouth is filled with excrement. it will break you of the habit quickly enough. - the dalai lama