[#1338] 1.8.0: possible socket problem with mswin32 builds — Jos Backus <jos@...>
Fyi: I tried the following command with two Ruby distributions on Windows 2003
5 messages
2003/08/05
[#1342] SEGV in GC under Linux — Dave Thomas <dave@...>
A while back I was getting double free()s reported on my MAC box when
5 messages
2003/08/05
[#1364] Broken REXML in Ruby 1.8 — Alexander Bokovoy <a.bokovoy@...>
Greetings!
1 message
2003/08/06
[#1378] differences between Module and Class ? — Mathieu Bouchard <matju@...>
25 messages
2003/08/11
[#1387] Re: differences between Module and Class ?
— matz@... (Yukihiro Matsumoto)
2003/08/12
Hi,
[#1442] Re: differences between Module and Class ?
— Mathieu Bouchard <matju@...>
2003/08/21
[#1452] Re: differences between Module and Class ?
— matz@... (Yukihiro Matsumoto)
2003/08/22
Hi,
[#1469] Re: differences between Module and Class ?
— Mathieu Bouchard <matju@...>
2003/08/23
[#1470] Re: differences between Module and Class ?
— matz@... (Yukihiro Matsumoto)
2003/08/24
Hi,
[#1472] Re: differences between Module and Class ?
— Mathieu Bouchard <matju@...>
2003/08/24
[#1444] Re: differences between Module and Class ?
— ts <decoux@...>
2003/08/21
>>>>> "M" == Mathieu Bouchard <matju@sympatico.ca> writes:
[#1381] proc/block with return — Mathieu Bouchard <matju@...>
9 messages
2003/08/11
[#1394] Std lib and updating PickAxe (was Re: proc/block with return) — "Gavin Sinclair" <gsinclair@...>
> [Dave wrote:]
5 messages
2003/08/13
[#1400] subclassing Structs — Eugene Scripnik <Eugene.Scripnik@...>
I'm trying to create class which behaves as struct (almost) and has some
5 messages
2003/08/13
[#1406] _id2ref bug? — Ryan Pavlik <rpav@...>
While debugging some caching code, I've come across a segfault related
22 messages
2003/08/14
[#1407] Re: _id2ref bug?
— matz@... (Yukihiro Matsumoto)
2003/08/14
Hi,
[#1413] Re: _id2ref bug? (REPRODUCED, short)
— Ryan Pavlik <rpav@...>
2003/08/14
On Fri, 15 Aug 2003 01:57:18 +0900
[#1415] Re: _id2ref bug? (REPRODUCED, short)
— matz@... (Yukihiro Matsumoto)
2003/08/15
Hi,
[#1416] Re: _id2ref bug? (another break)
— Ryan Pavlik <rpav@...>
2003/08/15
On Fri, 15 Aug 2003 09:21:39 +0900
[#1417] Re: _id2ref bug? (another break)
— nobu.nokada@...
2003/08/15
Hi,
[#1418] Re: _id2ref bug? (another break)
— Ryan Pavlik <rpav@...>
2003/08/15
On Fri, 15 Aug 2003 12:35:32 +0900
[#1424] Re: _id2ref bug? (another break)
— ts <decoux@...>
2003/08/15
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
[#1447] ruby-mode.el — Ryan Pavlik <rpav@...>
Attached is a patch for ruby-mode.el that adds font hilighting for
7 messages
2003/08/21
[#1450] Re: [PATCH] ruby-mode.el
— Ryan Pavlik <rpav@...>
2003/08/21
Crud, my mail has been slow, and I just got this back, but I realize I
[#1454] NODE_DSTR and NODE_EVSTR? — Robert Feldt <feldt@...>
How are "dynamic" strings represented internally?
7 messages
2003/08/22
Re: differences between Module and Class ?
From:
Mathieu Bouchard <matju@...>
Date:
2003-08-23 19:37:02 UTC
List:
ruby-core #1469
On Fri, 22 Aug 2003, Yukihiro Matsumoto wrote: > on 03/08/21, Mathieu Bouchard <matju@sympatico.ca> writes: > |2a. Class.new is moved to Object#new. A Class that does not have Object in > | its ancestor list does not inherit from Object#new and is thus > | uninstantiable. > (2a) breaks inheritance tree. It's not acceptable. Woops, I wanted to write: Class#new is moved to Object.new Which then makes sense, but supposing you understood me anyway, then I don't understand how it breaks things. Is anyone relying on new() being Class#new instead of Object.new ? It's just about bringing Class#new one level down the hierarchy, at a point where it does not seem to matter much: new() is supposed to create an Object, and so nothing more general than Object.new is going to be called, and in the current situation the method-lookup recurses from the class<<Object;self;end class to the Class class, whereas in my proposal it does not. And because all instances of Class are not directly of Class class, but instead are instances of metaclasses inheriting from the Class class, no-one can make the difference between Object.new and Class#new without using reflection. Is this correct? > In summary, your point is the following, right? > |2. Pickaxe says "multiple inheritance [can be] dangerous, as the > |inheritance hierarchy can become ambiguous. [Mixins] provide a controlled > |multiple-inheritance-like capability with none of the drawbacks" (p.23). > |Pickaxe was the first printed English book on Ruby, which for me was an > |appropriate successor to ruby-man-1.4, and quite elegantly written. > |However the part I've cited above is, after close examination, a wild, > |bold opinion that I find very difficult to agree with. > I know mix-in is restricted MI as you state. So the question is why > restrict where MI _can_ do it. > * at the point of I designed Ruby, the concept of "mix-in" was not > known widely. So I wanted to advocate "mix-in" by prohibiting > multiple inheritance, and making it a language feature. Well it would be important to differentiate the different contexts those words fit in. I am not being precise enough. Words change meaning from community to community. Ruby's Class/Module(/mixin) system is based on a method lookup which is listing inherited functionality in a priority order, calling the first, and then the "super" reserved word allows access to the next one. LISP/CLOS's class system is based on a method lookup which is listing inherited functionality in a priority order, calling the first found method, and then the call-next-method macro allows access to the next one. In LISP/CLOS, the term Mixin is sometimes used to designate a class that calls call-next-method on methods it does not inherit, so that when it's inherited from, it can override a previously unspecified class. This is exactly the functionality that you can do in LISP/CLOS but not in C++ or Ada or Perl (before 5.8). Apparently, the word Mixin also comes from LISP. However the LISP folks usually call their inheritance scheme "Multiple Inheritance". The phrase "Mixin Inheritance" is not very much used. In literature it may happen that Mixin Inheritance is mentioned in opposition to Multiple Inheritance. In that case, the latter really means Non-Mixin Multiple Inheritance. In that light, Ruby's inheritance is a restricted form of LISP's multiple inheritance. What I want is that Ruby gets the unrestricted form of LISP's multiple inheritance, and not any other kind of multiple inheritance. > * you can (or forced to) distinguish is-a relation to has-a relation > with "single inheritance w/ mix-in". I believe this distinction is > a good thing, which make relations clear. I don't know what it is to be bilingual Japanese/English, but I am bilingual French/English, and those are two rather related languages, and yet I could pull several examples where it is very much unclear what "is" and "has" deeply mean. Let's use a simple example. "I am hungry" could be translated into French as "Je suis affame", but in French no-one says that, and instead Frenchmen say "J'ai faim", which could be translated directly into English as "I have hunger", but then no-one says that either. If it is questioned whether this is a good example of how the perception of "having/being" is relative between languages, I can pull out many other examples if spending enough time finding them. Here my point is that even though IS-A and HAS-A of software design are expressed as a parallel with everyday life, they are still software concepts that can more precisely be described by HAS-A-POINTER-TO, HAS-A-SUBPART, IS-A-SUBCLASS-OF, CAN-DO-THIS, etc. And in such a case, given the common meaning of "subclassing", i don't see how #including a Module can be anything else than IS-A-SUBCLASS-OF, and i don't see how further hairsplitting is improving anything. All of this as a prelude to asking you: What are your precise definitions of IS-A and HAS-A ? ________________________________________________________________ Mathieu Bouchard http://artengine.ca/matju