Re: To CLOS or not to CLOS?

Matthias Felleisen <[email protected]> Sat, 24 Feb 2007 12:28:57 -0500
Newsgroups gmane.comp.lang.lightweight
Message-ID <[email protected]>
On Feb 24, 2007, at 12:23 PM, Pascal Costanza wrote:

> No, I mentioned Smalltalk-style traits. See http://www.iam.unibe.ch/ 
> ~scg/Research/Traits/index.html
>
> And no, I am not aware of an implementation in Common Lisp.


You may wish to study Matthew Flatt's invited talk at APLAS on how to  
add mixins and traits to Scheme via macros:

    http://www.ccs.neu.edu/scheme/pubs/ #APLAS

Warning: these mixins are NOT CL-style mixins. They are closer to  
what Matthew did for this thesis (and alluded to in his LL1 talk).


-- Matthias


























> I have played a little with the idea to see how the CLOS MOP could  
> be used to implement such traits, but I see some non-trivial issues  
> with multiple dispatch here. I didn't have the time yet to figure  
> out the details. Without multiple dispatch, such traits would be  
> straightforward to support, AFAICT.
>
> I haven't thought about Self-style traits in Common Lisp yet. The  
> inheritance of shared slots between class metaobjects can be  
> considered a form of delegation, and together with class-prototype,  
> you basically have some form of a prototype-based object system at  
> the class metaobject level. IIUC, Self-style traits are "just" a  
> programming convention, so I would guess that there is no serious  
> issue here.
>
> But take these statements with a lot of salt!
>
>
> Pascal
>
> On 24 Feb 2007, at 18:15, Matthew D Swank wrote:
>
>> You mentioned (in another message I don't seem to have anymore) Self
>> style traits as an alternative to multiple inheritance.  Are there  
>> any
>> toy Common Lisp implementations of such a thing?
>>
>> Pascal Costanza wrote:
>>>
>>> On 20 Feb 2007, at 21:31, [email protected] wrote:
>>>
>>>>     I can agree with all of the good things you say about CLOS;  
>>>> but the
>>>> interesting (to me) bit is, what could be done better?  For  
>>>> example:
>>>>
>>>> - Other things I missed that experienced CLOS users would  
>>>> criticize or
>>>> improve if they could?
>>>
>>> Sure:
>>>
>>
>> Matt
>>
>> -- 
>> "You do not really understand something unless you can explain it to
>> your grandmother." — Albert Einstein.
>
> -- 
> Pascal Costanza, mailto:[email protected], http://p-cos.net
> Vrije Universiteit Brussel, Programming Technology Lab
> Pleinlaan 2, B-1050 Brussel, Belgium
>
>
>
>
>