From: Intransition Date: 2012-04-23T01:45:29+09:00 Subject: Re: Why must I know whether I extend a class or a module? ------=_Part_1145_262848.1335113126389 Content-Type: multipart/alternative; boundary="----=_Part_1146_22064412.1335113126389" ------=_Part_1146_22064412.1335113126389 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Sunday, April 22, 2012 9:01:53 AM UTC-4, Matthew Kerwin wrote: > > On 22 April 2012 18:01, Intransition wrote: > > Well, it's funny you should ask. That has always been Matz' goto reason > > against the idea. He "hates" multiple inheritance and he sees this as > such. > > That's ... absurd; the 'include' statement is the paragon of multiple > inheritance. I always thought that the search path from class to > modules to superclass and so on was a brilliant solution to such a > frequently murky and messy topic. > > My worldview is somewhat shaken now. > Pretty much my sentiments exactly. > >> I guess I have a hole in my instinctive response for the right > >> approach to 'modules as a namespace', since I usually use them as > >> interfaces/multiple-inheritance/mixins. > > > > I have considered forking Rubinius and implementing this --but I am not > 100% > > sure how involved it would be. > > I'm sorry, implementing what, precisely? > Basically: 1) Allow classes to be included. 2) Allow modules to be instantiated. 3) Allow module's class-methods to be "inherited" just like class' class-methods. This would effectively make classes and modules exactly same. Also, 4) Auto-instantiate namespaces. 5) Make toplevel a self extended module that doesn't infect all objects. ------=_Part_1146_22064412.1335113126389 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On Sunday, April 22, 2012 9:01:53 AM UTC-4, Matthew Kerwin wrote:On 22 April 2012 18:01, Intransi= tion <transfire= @gmail.com> wrote:
> Well, it's funny you should ask. That has= always been Matz'  goto reason
> against the idea. He "hates" m= ultiple inheritance and he sees this as such.

That's ... absurd; the 'inc= lude' statement is the paragon of multiple
inheritance.  I always t= hought that the search path from class to
modules to superclass and so o= n was a brilliant solution to such a
frequently murky and messy topic.

My worldview is somewhat shaken now.


Pretty much my sentiments exactly.
 

>> I guess I have a hole in my i= nstinctive response for the right
>> approach to 'modules as a nam= espace', since I usually use them as
>> interfaces/multiple-i= nheritance/mixins.
>
> I have considered forking Rubinius and i= mplementing this --but I am not 100%
> sure how involved it would be.=

I'm sorry, implementing what, precisely?

Basica= lly:

1) Allow classes to be included.
2)= Allow modules to be instantiated.
3) Allow module's class-method= s to be "inherited" just like class' class-methods.

This would effectively make classes and modules exactly same.
<= br>
Also,

4) Auto-instantiate namespaces= .
5) Make toplevel a self extended module that doesn't infect= all objects.

------=_Part_1146_22064412.1335113126389-- ------=_Part_1145_262848.1335113126389--