[Nitro] Better than classinherit.rb!
itsme213
itsme213 at hotmail.com
Tue Apr 11 11:28:52 EDT 2006
From: "TRANS" <transfire at gmail.com>
> How many man-hours could have been
> saved!!!!!!!!
Sounds like a great candidate for the 1.9/2.0 stream ... but then what do I
know !
>> - Do you know any hooks that would enable the inverse operation:
>> R.is_not(M)
> source code itself has a problem here in the way it works, so I'm not
> sure it would ever be possible --it is related to the Dynamic Module
> Problem: Module's themselves are only dynamic upto two layers of
> inclusion for any including object after it has been instantiated).
Ouch.
>> There are advantages to your older ClassMethods (and less so
>> InstanceMethods) convention, since they require a module holding methods
>> uniformly for either classes or 'other' objects. I have been doing the
>> following. Could probably be simplified further by someone more expert
>> than
>> I ...
>
> Yes. That has advanages of it's own. Unfortuately it has it's own
> corner casses too --it won't work with cattr for instance.
I think by having each ClassMethods module know about it's corresponding
InstanceMethods module one could make cattr work.
But I think class variables should be banned in any scheme that properly
does ClassMethods and InstanceMethods.
More information about the Nitro-general
mailing list