what's new in 3.8
lecteur at zogotounga.net
Sat Dec 11 18:28:21 UTC 2004
Marcus Denker wrote:
> 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:
> "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.
that's interesting. however, I noticed that alt-n on "#thisIsATest"
gives no implementor. also, I did
behavior compile: 'anotherTest ^ self gloup'
and alt-m on "gloup" also gives no senders.
raises a debugger as expected (since #gloup is undefined), but the
debugger fails with a DNU on Behavior>>organization when its first lines
I would be very interested in this type of anonymous Behavior, but I
would need the instance specific code to be accessible through the usual
requests. would this be possible ?
More information about the Squeak-dev