what's new in 3.8
Marcus Denker
denker at iam.unibe.ch
Sat Dec 11 17:16:23 UTC 2004
Am 11.12.2004 um 18:09 schrieb Stéphane Rollandin:
> Marcus Denker wrote:
>> I started a list of what was added to 3.8
> ...
>> -support for anonymous Behaviors
>
> what is this ? is it documented somewhere ?
>
It allows you to create a minimal lighwight class with no name by
doing "Behavior new". This can for example be used for emulating
instance specific behavior:
testChange
"self run: #testChange"
| behavior browser |
behavior := Behavior new.
behavior superclass: Browser.
behavior setFormat: Browser format.
browser := Browser new.
browser primitiveChangeClassTo: behavior new.
behavior compile: 'thisIsATest ^ 2'.
self assert: browser thisIsATest = 2.
self should: [Browser new thisIsATest] raise: MessageNotUnderstood.
More information about the Squeak-dev
mailing list
|