Why You Might Want to Try Ruby
started 1/13/2002; 8:43:37 AM - last post 1/14/2002; 2:09:54 PM
|
|
Ehud Lamm - Why You Might Want to Try Ruby
1/13/2002; 8:43:37 AM (reads: 699, responses: 4)
|
|
|
Manuel Simoni - Re: Why You Might Want to Try Ruby
1/13/2002; 11:21:53 AM (reads: 710, responses: 0)
|
|
Does anybody know why Ruby's inheritance mechanism is called "single", when it actually allows multiple-inheritance via "mix-ins"?
Aren't those mixins equivalent to "mixing in" a class in C++?
Thanks
PS: A longer and even more enthusiastic article about this nice language is here: http://www.ddj.com/documents/s=871/ddj0101b/0101b.htm
|
|
Bill - Re: Why You Might Want to Try Ruby
1/13/2002; 10:11:21 PM (reads: 686, responses: 0)
|
|
If class C mixes-in module M, C gets the methods in M. But M is not a superclass of C. C does not extend M. A C is not an M. Etc.
But there's an interesting implemenation detail. Even though C does not get M as a superclass, C does get an anonymous superclass which delegates calls to the mixed-in methods to module M. See http://dev.rubycentral.com/book/classes.html#UC
bill
|
|
Manuel Simoni - Re: Why You Might Want to Try Ruby
1/14/2002; 9:43:04 AM (reads: 612, responses: 0)
|
|
Thanks Bill.
|
|
Ehud Lamm - Re: Why You Might Want to Try Ruby
1/14/2002; 2:09:54 PM (reads: 595, responses: 0)
|
|
re mixins you may find this paper interesting:
ICFP 98
Findler and Flatt
Modular Object-Oriented Programming with Units and Mixins
DVI
PDF
PS
HTML
Code
It is interesting to note the Ada's approach to mixins is based on a similar approach: generic units parametrized over the parent type.
|
|
|
|