From: Mariano Montone
Subject: CLOS metaclasses composition
Date: 
Message-ID: <943d9694-ee37-46f2-9d11-6e9ec4c77493@t21g2000yqi.googlegroups.com>
Hi!

     Do you have any thoughts, code or pointers on CLOS metaclasses
composition?

Thanks!

Mariano

From: Alberto Riva
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <h0bjpe$kb$1@usenet.osg.ufl.edu>
Mariano Montone wrote:
> Hi!
> 
>      Do you have any thoughts [...] on CLOS metaclasses
> composition?

Just one: what is CLOS metaclass composition?

Alberto
From: Mariano Montone
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <c2b942ff-c581-4263-9c4b-494d47abaaf7@f19g2000yqo.googlegroups.com>
On 5 jun, 14:14, Alberto Riva <····@nospam.ufl.edu> wrote:
> Mariano Montone wrote:
> > Hi!
>
> >      Do you have any thoughts [...] on CLOS metaclasses
> > composition?
>
> Just one: what is CLOS metaclass composition?
>
> Alberto

I want the behavior of a class to be determined by several meta
classes, not just one.

There's some research made on that here:
http://www.esug.org/data/ESUG2004/ESUG2004-RT-MetaclassTraits.pdf and
here: http://vst.ensm-douai.fr/MetaclassTalk/uploads/1/mixinsForSafeMetaclassComposition.NouryBouraqadi.bled25aug2003.pdf

But it seems I will have to investigate meta class composition in CLOS
on my own.

Mariano
From: Kenneth Tilton
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <4a29a8f8$0$5897$607ed4bc@cv.net>
Mariano Montone wrote:
> On 5 jun, 14:14, Alberto Riva <····@nospam.ufl.edu> wrote:
>> Mariano Montone wrote:
>>> Hi!
>>>      Do you have any thoughts [...] on CLOS metaclasses
>>> composition?
>> Just one: what is CLOS metaclass composition?
>>
>> Alberto
> 
> I want the behavior of a class to be determined by several meta
> classes, not just one.
> 
> There's some research made on that here:
> http://www.esug.org/data/ESUG2004/ESUG2004-RT-MetaclassTraits.pdf and
> here: http://vst.ensm-douai.fr/MetaclassTalk/uploads/1/mixinsForSafeMetaclassComposition.NouryBouraqadi.bled25aug2003.pdf
> 
> But it seems I will have to investigate meta class composition in CLOS
> on my own.

Why? Until now no one had a clue what you were talking about. If you 
want to get sarcastic, make a wisecrack about first your lack of 
communication skills and then your prickliness.

Back OT: research? What are you, an academic? STFU and create a 
metaclass that multiply inherits from other metaclasses: it works.

hth, kt
From: Mariano Montone
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <f2ec2d93-0bb7-48db-aa11-18fbb36103e7@x6g2000vbg.googlegroups.com>
On 5 jun, 20:23, Kenneth Tilton <·········@gmail.com> wrote:
create a
> metaclass that multiply inherits from other metaclasses: it works.
>
> hth, kt

That's all I wanted to hear. No need to be aggressive.

Mariano
From: Kenneth Tilton
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <4a29cddc$0$31268$607ed4bc@cv.net>
Mariano Montone wrote:
> On 5 jun, 20:23, Kenneth Tilton <·········@gmail.com> wrote:
> create a
>> metaclass that multiply inherits from other metaclasses: it works.
>>
>> hth, kt
> 
> That's all I wanted to hear.

No, you wanted to hear something more generally useful: The MOP uses 
CLOS as well as implements it, so there was no need for the specific 
question about multiple inheritance.

> No need to be aggressive.

You're no fun.

kt
From: Mariano Montone
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <bcd250a2-22b4-4d0d-90c7-47ce1b65a916@b1g2000vbc.googlegroups.com>
On 5 jun, 23:01, Kenneth Tilton <·········@gmail.com> wrote:
> Mariano Montone wrote:
> > On 5 jun, 20:23, Kenneth Tilton <·········@gmail.com> wrote:
> > create a
> >> metaclass that multiply inherits from other metaclasses: it works.
>
> >> hth, kt
>
> > That's all I wanted to hear.
>
> No, you wanted to hear something more generally useful: The MOP uses
> CLOS as well as implements it, so there was no need for the specific
> question about multiple inheritance.

My question was not about multiple inheritance. I wanted to see some
code that does meta classes composition!! Or some advice, whatever.
It's ok if you don't have any. But you get angry. I don't understand.
>
> > No need to be aggressive.
>
> You're no fun.

Take it easy, man!

Mariano
From: Kenneth Tilton
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <4a29f32f$0$31260$607ed4bc@cv.net>
Mariano Montone wrote:
> On 5 jun, 23:01, Kenneth Tilton <·········@gmail.com> wrote:
>> Mariano Montone wrote:
>>> On 5 jun, 20:23, Kenneth Tilton <·········@gmail.com> wrote:
>>> create a
>>>> metaclass that multiply inherits from other metaclasses: it works.
>>>> hth, kt
>>> That's all I wanted to hear.
>> No, you wanted to hear something more generally useful: The MOP uses
>> CLOS as well as implements it, so there was no need for the specific
>> question about multiple inheritance.
> 
> My question was not about multiple inheritance. I wanted to see some
> code that does meta classes composition!!

Oh, I thought you said:

> I want the behavior of a class to be determined by several meta
> classes, not just one.

So you wanted the determination not to be by inheritance? Perhaps by 
gravitational pull? Well, then, put them really close together in your 
source code, there's an inverse square relation to distance, you know.

> Or some advice, whatever.
> It's ok if you don't have any.

I don't have any? You already thanked me for providing the information 
you requested. Any flickering hope we had left for you is about to wink out.

> But you get angry. I don't understand.
>>> No need to be aggressive.
>> You're no fun.
> 
> Take it easy, man!

Sure, after I rip your heart out and eat it.

hth, kt
From: Pillsy
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <6f84b7f2-eaf7-417d-a1d2-18f8fe1c025b@z7g2000vbh.googlegroups.com>
On Jun 6, 12:40 am, Kenneth Tilton <·········@gmail.com> wrote:
[...]
> Sure, after I rip your heart out and eat it.

Kenneth Tilton *is* Mola Ram.

Later,
Pillsy
From: Mariano Montone
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <ea4be525-ce35-4743-b1b7-92f81e284935@z19g2000vbz.googlegroups.com>
On 6 jun, 01:40, Kenneth Tilton <·········@gmail.com> wrote:
> > I want the behavior of a class to be determined by several meta
> > classes, not just one.
>
> So you wanted the determination not to be by inheritance? Perhaps by
> gravitational pull? Well, then, put them really close together in your
> source code, there's an inverse square relation to distance, you know.
>
> > But you get angry. I don't understand.
> >>> No need to be aggressive.
> >> You're no fun.
>
> > Take it easy, man!
>
> Sure, after I rip your heart out and eat it.
>
> hth, kt

Haha,  you are funny!! Hope you are not dangerous!!

Mariano
From: Raffael Cavallaro
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <h0ds12$9eh$1@news.eternal-september.org>
On 2009-06-06 09:45:42 -0400, Mariano Montone <··············@gmail.com> said:

> Haha,  you are funny!! Hope you are not dangerous!!

only in front of a keyboard ;^)

-- 
Raffael Cavallaro
From: Kenneth Tilton
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <4a2a8fe5$0$22552$607ed4bc@cv.net>
Mariano Montone wrote:
> On 6 jun, 01:40, Kenneth Tilton <·········@gmail.com> wrote:
>>> I want the behavior of a class to be determined by several meta
>>> classes, not just one.
>> So you wanted the determination not to be by inheritance? Perhaps by
>> gravitational pull? Well, then, put them really close together in your
>> source code, there's an inverse square relation to distance, you know.
>>
>>> But you get angry. I don't understand.
>>>>> No need to be aggressive.
>>>> You're no fun.
>>> Take it easy, man!
>> Sure, after I rip your heart out and eat it.
>>
>> hth, kt
> 
> Haha,  you are funny!! Hope you are not dangerous!!

I only actually attack bouncers which they seem to enjoy greatly, breaks 
up a long night.

kt
From: Pascal Costanza
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <78urf8F1mj2lrU2@mid.individual.net>
Mariano Montone wrote:
> On 5 jun, 14:14, Alberto Riva <····@nospam.ufl.edu> wrote:
>> Mariano Montone wrote:
>>> Hi!
>>>      Do you have any thoughts [...] on CLOS metaclasses
>>> composition?
>> Just one: what is CLOS metaclass composition?
>>
>> Alberto
> 
> I want the behavior of a class to be determined by several meta
> classes, not just one.
> 
> There's some research made on that here:
> http://www.esug.org/data/ESUG2004/ESUG2004-RT-MetaclassTraits.pdf and
> here: http://vst.ensm-douai.fr/MetaclassTalk/uploads/1/mixinsForSafeMetaclassComposition.NouryBouraqadi.bled25aug2003.pdf

Mixins can indeed solve some problems of metaclass composition (but I 
don't think these are the most interesting ones).

In CLOS, using mixins is "just" a programming style, the restrictions of 
a particular mixins (or traits) model are not enforced. In general, 
Common Lisp trusts programmers to know what they are doing, and there 
are always reasons to break rules, so... ;)


Pascal

-- 
ELS'09: http://www.european-lisp-symposium.org/
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Pascal Costanza
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <78ur19F1ntrrfU1@mid.individual.net>
Mariano Montone wrote:
> Hi!
> 
>      Do you have any thoughts, code or pointers on CLOS metaclasses
> composition?

As Kenny, in his usual irritating style, already pointed out, in CLOS 
you can do metaclass composition by way of multiple inheritance. In 
practice, CLOS multiple inheritance is usually used for mixin-style 
class composition, but it is slightly more general than that. 
Nevertheless, it's a good approximation to think about it like that.

Since metaclasses are in general not composable, the CLOS MOP specifies 
a generic function validate-superclass, which you have to override to 
enable composition of certain metaclasses. Since this is somewhat 
annoying, most CLOS MOP code actually unlocks metaclass composition / 
metaclass inheritance in a quite liberal way, which is ok in most cases.

There are no papers or articles that I am aware of that discuss this 
topic for the CLOS MOP. There is, however, a good book by Danforth and 
Forman called "Putting Metaclasses to Work" which discusses some of the 
metaclass compatibility issues for a C++-based MOP, many of which are 
also applicable for CLOS MOP.

I use metaclass composition by way of multiple inheritance quite heavily 
in ContextL, exactly for the purpose to keep the implementations of 
different language constructs separate (which are implemented as 
metaclasses). You can get the source code for studying this here: 
http://common-lisp.net/project/closer/contextl.html

You should also be able to find other examples in the usual Common Lisp 
repositories. For example, I am aware of cl-dwim using metaclass 
composition at least to a certain extent. See 
http://common-lisp.net/project/cl-dwim/

I hope this helps a bit.


Pascal

-- 
ELS'09: http://www.european-lisp-symposium.org/
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Mariano Montone
Subject: Re: CLOS metaclasses composition
Date: 
Message-ID: <1e721d0e-13b0-41a8-9910-71b49ffee761@y9g2000yqg.googlegroups.com>
Thanks Pascal for your answers!!

Cheers, Mariano