Classboxes
Bergel, Alexandre
bergel at iam.unibe.ch
Tue Feb 13 11:40:43 UTC 2007
The class LocalRebindingTests contains few tests. You will find a
relevant one below.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
testClassExtension5
"self run: #testClassExtension5"
"Message sent"
| cx1 cx2 |
cx1 _ self createClassboxNamed: #CX1.
cx2 _ self createClassboxNamed: #CX2.
"----"
cx1 import: #Object from: system.
cx1 createClassNamed: #TestCXA.
cx1 createClassNamed: #TestCXB.
cx1 createClassNamed: #TestCXC.
cx1 addMethod: 'foo ^ TestCXB new foo' for: #TestCXA.
cx1 addMethod: 'foo ^ TestCXC new foo' for: #TestCXB.
cx1 addMethod: 'foo ^ 1' for: #TestCXC.
"----"
cx2 import: #Object from: system.
cx2 import: #TestCXC from: cx1.
cx2 addMethod: 'foo ^ 2' for: #TestCXC.
cx2 import: #TestCXA from: cx1.
"----"
self assert: (cx1 evaluate: 'TestCXA new foo') = 1.
self assert: (cx2 evaluate: 'TestCXA new foo') = 2.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cheers,
Alexandre
Am Feb 11, 2007 um 6:10 PM schrieb Viktor Svub:
> Lex Spoon napsal(a):
>> Gilrandir <gilrandir at centrum.cz> writes:
>>> Hi all,
>>> i'm looking for a decent module system for Squeak and i'm playing
>>> with
>>> Classboxes - they seem to be ideal - it's still pure Smalltalk, they
>>> work together with Traits, but there seems to be something
>>> broken: in
>>> Classbox>>scope is an attempt to instantiate a class named
>>> Environment, which is nowhere to be found
>> I don't think Classboxes is maintained. For experimentation, you
>> should dig up the correct older version of Squeak for it -- does
>> anyone know what that would be? If you want to continue using them
>> beyond experimentation, then either you need to use it with the old
>> version of Squeak, or you need to update it personally.
> I'm pretty sure Classboxes is not maintained anymore, though in my
> opinion, it't "the module system for Squeak, done right" and i'd
> like to test to use it myself. I don't know which version of Squeak
> is the right one, and i wanted to update it fo 3.9 - but i'm not
> able to infer, which class should i use instead of Environment or
> how to work around this.
>
>> By the way, there are some other module-related tools that are
>> actively maintained. Monticello is a great for managing code given
>> the current Squeak design; it won't prevent clashes between packages,
>> but at least it will tell you when they happen. Package universes is
>> my toolkit for helping people manage sets of mutually compatible
>> packages; given such a toolkit, the need for a good module system is
>> lessened.
> I kind of really like the Squeaks' module and packaging tools, but
> it just doesn't feel right to me - i don't like to depend of any
> tools of this kind, without the "real" low-level (or first-order,
> i'm not sure how to put this in english) facility backing them.
>
>> -Lex
> Though i'm not looking for a solution rigth now, but just for a way
> to get Classboxes going, thank you :)
>
> Viktor Svub
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.cs.tcd.ie/Alexandre.Bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
More information about the Squeak-dev
mailing list
|