ThingLab
Dan Ingalls
DanI at wdi.disney.com
Tue Jan 26 22:34:15 UTC 1999
>I may have missed this someplace, but in the method
>
> ThingLabInstance makeMethodFor: message
>
>there are constructs like:
>
> recursive ifTrue: [#copy.instance:] ifFalse: [#set.instance:]
>
>What are these blocks?
Les -
For the benefit of others, this expression occurred in the following construct...
copyNode _ MessageNode new
receiver: defNode
selector: (recursive ifTrue: [#copy.instance:] ifFalse: [#set.instance:])
arguments: (Array with: (encoder encodeVariable: 'self'))
precedence: #copy.instance: precedence
from: encoder.
so copyNode is being set to a MessageNode whose selector is one of two Symbols. To understand where this leads, you have ot jump to TL's def for doesNotUnderstand:, which begins with...
"added ThingLab code follows: "
(self tryCompilingThingLabCodeFor: aMessage selector) ifTrue:
[^self perform: aMessage selector withArguments: aMessage arguments].
This in turn will compile the necessary sharing or copying method on demand, but I haven't tracked it down any farther than that. Some of it may not even work yet, as I don't think any of the examples I tried triggered this code.
- Dan
More information about the Squeak-dev
mailing list
|