From: Mathieu Bouchard Date: 2005-04-24T23:35:57+09:00 Subject: Re: [ANN] Article: Seeing Metaclasses Clearly ---1077017559-1125945308-1114353337=:32332 Content-Type: MULTIPART/MIXED; BOUNDARY="-1077017559-1125945308-1114353337=:32332" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1077017559-1125945308-1114353337=:32332 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 24 Apr 2005, gabriele renzi wrote: > Mathieu Bouchard ha scritto: >> On Thu, 21 Apr 2005, ts wrote: >>> * a class is a module which can use inheritance > I disagree, thinking that mixins and multiple inheritance are not the sam= e=20 > thing, and should not be pointed as such. Take a look at the inheritance mechanism in CommonLISP and how the=20 (call-next-method) macro works in LISP and then you won't be able to=20 honestly tell me that mixins are not inheritance and that Ruby's mixins=20 aren't like Lisp's classes. Really. Go see for yourself. >> 1. a Ruby class is a direct-subclass-of a Ruby class using the "<" notat= ion=20 >> (except the Object class). >> 2. the Object class just happens to be the place where .new() is defined= ;=20 >> and this is no matter how many classes use undef_method(:new) to forbid= =20 >> instantiation. > Is'nt it Class#new ? Sorry, yes. But it amounts to the same thing, because the (Object)=20 metaclass is the sole direct descendant of Class, and the creation of a=20 new class never can add a new direct descendent to Class, and so it would= =20 be possible to unify the (Object) metaclass and the Class class and=20 frankly no-one would notice. Guy Decoux and you are right on this detail, but this detail is not=20 important in my point, and here is what I mean: I mean that what makes a=20 class a class is that it inherits from whatever is the sole authority for= =20 making new objects, and that's something that non-class modules don't have= =20 access to. (And although there *are* some pieces of code that might construct new=20 objects without the help of Class#new, it isn't the one you can use for=20 building objects of your own custom-designed non-singleton classes) Does that clear up things a bit? ,-o---------o---------o---------o-. ,----. | | The Diagram is the Program (TM) | | ,-o----------------------------o-. `-o-----------------------------o-' | | Mathieu Bouchard (Montr=E9al QC)= | | |---' | http://artengine.ca/matju | | | `-o------------------------------' ---1077017559-1125945308-1114353337=:32332-- ---1077017559-1125945308-1114353337=:32332--