From: Christian Neukirchen Date: 2006-06-18T03:28:39+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? why the lucky stiff writes: > On Sat, Jun 17, 2006 at 01:28:12AM +0900, Christian Neukirchen wrote: >> Instead of further pythonizing the language (sorry, couldn't resist), >> I'd rather prefer a non-OO way for the tricky cases: >> >> Object.object_id_of myobj >> Object.class_of myobj >> Object.send_to myobj, :foo > > So, it quacks like a dog, but if we really press it, we can get a proper > fowlsome noise? > > >> duck.quack > >> # > # .. uh.. let's try this again, that was a bit noisey > >> Animal.come_on_gimme_the_real_duck_quack duck > => # > > I'm not saying it's a totally bad idea. I just don't think I'd be able to spot > when Object.object_id_of is necessary. I mean when in advance do you know > you're getting nasty mangled objects that don't behave? I generally try to use > __send__ right now. I figure if __send__ is overridden, then someone has > figured out a better way to dispatch methods. Hey, let's let them try. And what if I still feel more meta than you? ;-) Note that e.g. Ruby itself won't call the updated definition of __send__... > _why -- Christian Neukirchen http://chneukirchen.org