Metaclasses and co.
Alexandre Bergel
Alexandre.Bergel at cs.tcd.ie
Mon Feb 20 22:36:55 UTC 2006
According to the wiki page, Squeak 3.2 seems to be the platform used
for Metaclasstalk...
Do you have the changeset somewhere ? Will it work with squeak 7000 ?
Traits showed it should be difficult to make a .mcz file for this
kind of think...
Cheers,
Alexandre
Am Feb 20, 2006 um 9:16 PM schrieb Noury Bouraqadi:
> Hi,
>
> Remember there is MetaclassTalk (http://csl.ensm-douai.fr/
> MetaclassTalk) that provides explicit metaclasses and other
> reflective facilities for Squeak. You can define your own
> metaclasses and use them in order to have classes with the
> following protocole :
>
> Object subclass: #Person
> instanceVariableNames: 'name age '
> classVariableNames: ''
> poolDictionaries: ''
> category: 'MetaclassTalk-Examples'
> metaclass: MyMetaclass
>
> One intersting application of explicit metaclasses I did is to
> extend Smalltalk with mixin-based inheritance.
> However, neither implicit metaclasses (with parallel hierarchies)
> nor explicit metaclasses are totally satisfactory. Actually, there
> should be a mix of both (see my papers on metaclass compatibility
> OOPSLA98, ESUG2003).
>
> Noury
> Le 16 févr. 06, à 19:37, Bergel, Alexandre a écrit :
>
>> Today I spend some time to read and understand an old mail from
>> Andreas (http://lists.squeakfoundation.org/pipermail/squeak-dev/
>> 2005-October/096370.html) about having a parallel metaclass
>> hierarchy. I really like this.
>>
>> Thanks Andreas!!
>>
>> I wrote a short test to understand it, I think it might interest
>> some of you:
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> testClassCreation
>> "self debug: #testClassCreation"
>> | mcls cls |
>>
>> mcls := MyMetaclass
>> subclass: #MC
>> instanceVariableNames: ''
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'MyMetaClassesGenerated'.
>> cls := MyObject
>> subclass: #C
>> instanceVariableNames: ''
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'MyMetaClassesGenerated'
>> metaclass: mcls.
>> classCreated addAll: {mcls . cls}. "Used in teardown to remove
>> the classes"
>>
>> mcls compile: 'foo ^20'.
>>
>> self assert: (cls new class == cls).
>> self assert: (cls class name = 'C class').
>> self assert: (cls class class == mcls).
>> self assert: (cls class class class class == MyMetaclass).
>> self assert: (cls class soleInstance == cls).
>>
>> self assert: (cls canUnderstand: #foo) not.
>> self assert: (cls class respondsTo: #foo).
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.cs.tcd.ie/Alexandre.Bergel
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
> --------------------------------------------------------------
> Dr. Noury Bouraqadi - Enseignant/Chercheur
> Ecole des Mines de Douai - Dept. G.I.P
> http://csl.ensm-douai.fr/noury
>
> European Smalltalk Users Group Board
> http://www.esug.org
>
> Squeak: an Open Source Smalltalk
> http://www.squeak.org
> --------------------------------------------------------------
>
>
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.cs.tcd.ie/Alexandre.Bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
More information about the Squeak-dev
mailing list
|