"Ara.T.Howard" <Ara.T.Howard / noaa.gov> writes:

>>> and, of course, you still can't inherit from M - but i
>>> realize this needed be so.
>>
>> Yes, you can:
>>
>>   module N
>>     include M
>>   end
>
> the problem is a bit deeper than that and stem from the
> fact that including a module does not inject the included
> modules singleton methods into the 'includee'.

Right, but to me that is just another reason to unify.
How is this inconsistency a feature?  Why is it not fixed?

Does any code depend on the fact that including a module
does not pull in its singleton methods?

(This deserves a thread of its own, and in fact probably
already has at least one.  I'll search the archives later.)

> [snipped nice example code]

> i'm not saying it's not possible - just that it's a bit
> more work than you're suggesting.  doing things
> consistently at an object, class, module, and
> singleton_class level gets very confusing very quicky -
> just check out the code for my traits lib to see just how.
> ;-)
>
> i personally often get around this detail by
>
>    module M
>      module ClassMethods
>      end
>      module InstanceMethods
>      end
>      include InstanceMethods
>      self.extend ClassMethods
>      def self::included other
>        class << other
>          include InstanceMethods
>        end
>        other.extend ClassMethods
>      end
>    end
>
> or something similar - in otherwords factor out class
> methods so that can be added individually to other
> classes/modules when they are included there.  thus begins
> the trickiness...

Yes, I use similar hacks too.  But don't you agree that it
would be nicer if modules and classes were consistent in
this regard, rendering these hacks unnecessary?

(I realize that I'm shifting the discussion instead of
meeting your arguments.)

> (ps. for some reason the charset from your message is very
> odd - it may be on my end but thought you might like to
> know.  it looks like some sort of escape chars around '@'
> signs - coloring?)

Hmm... sounds weird.  I do tend to use Unicode characters,
specifically quotation marks.  How does this look?

                  °∆foo°«    °»bar°…

It's supposed to be the word foo in single quotes followed
by the word bar in double quotes.

-- 
Daniel Brockman <daniel / brockman.se>

    So really, we all have to ask ourselves:
    Am I waiting for RMS to do this?   --TTN.