[Mono-list] Re: Is Objective-C support possible?

Thomas F. Burdick tfb@OCF.Berkeley.EDU
Fri, 15 Feb 2002 13:09:24 -0800


Martin Coxall writes:
 > >  > In any case the CLR is designed to avoid that by making its requirement of
 > >  > multiply inherited classes be abstract, so if you want broken OO via impure
 > >  > Mixins, I wouldn't expect the CLR to ever support that. ILX would still
 > >  > support the CLR notion of single inheritance, multiple interfaces.
 > > 
 > > You're talking about interfaces, not mixins.  The term came from the
 > > Flavors object system for Lisp, and mixins *do* come with
 > > implementations.  They're little classes that aretn't terribly useful
 > > by themselves, but when mixed in with a substantial class, add
 > > functionality.
 > 
 > Which from a modern OO perspective is a Very Bad Thing. Which is why
 > neither Java nor C# support them.

Bah.  You seem to have missed the point that the OP was asking about:
whether the .NET CLR can support more than just languages that look
like C#.  I would agree that mixin classes would be a bad idea in Java
or C#.  But not all languages are like C#.  For dynamically-typed
languages, mixins do *not* break encapsulation.

 > To achieve what you want without breaking encapsulation, use the
 > decorator pattern. Again if refer to Gang of Four.

Such patterns are specific to languages like C++.  They apply somewhat
to Smalltalk, but really little at all to Lisp.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'