On Wed, Mar 07, 2007 at 09:09:59PM +0900, Trans wrote:
> On Mar 7, 6:00 am, Brian Candler <B.Cand... / pobox.com> wrote:
> > On Wed, Mar 07, 2007 at 07:46:56PM +0900, Brian Candler wrote:
> > > And this is straightforward to implement:
> >
> > Alternatively, make your own methods on the objects themselves, giving them
> > whatever consistent naming scheme you feel like:
> 
> 
> Woh! Now you're undermining the very reasons for doing this. If we all
> go willy nilly naming these things whatever we want we'll be in a
> worse can of soup thatn we were to begin with.

I was just trying to make something which might be more palatable to the OP.

If I understand rightly, he would rather use foo#object_class,
foo#object_send, foo#object_method etc. as a way of lexically identifying
these methods as "meta programming methods". I showed how he could implement
exactly what he asks for, where he wants it, without demanding changes to
the core Ruby language.

However I agree with you - explicit reflections (which take an object as an
argument, rather than being methods on all objects) are probably a better
idea, to avoid the clutter.

I think the argument is moot unless Matz decides to go this way in a later
version of Ruby; otherwise we'll still have method soup anyway :-)

However I understand that Ruby 2.x is going to have a BasicObject /
BlankSlate though - in which case, maybe the reflections could all be put in
a module.

Regards,

Brian.