[Newcompiler] How does the CaptureVar work
Marcus Denker
denker at iam.unibe.ch
Tue Jul 3 12:15:17 UTC 2007
On 01.07.2007, at 23:49, Mathieu Suen wrote:
> Hi,
>
> Does anyone know when the CaptureVar are build and why?
I think it is this...:
1) Closure mode:
There are two types of variables: TempVar and CapturedVar. TempVars
are temporaries that are not referenced from blocks.
Thus in a case like this:
| a |
[a].
the a would be a captured var, as the block could live longer then
the activiation of the method, it needs to be independed of it.
Instance variables are modeled as Captured Vars, too (receiverVar is
then "self").
2) Non-Closure mode:
If I rememer correctly, in non-closre mode al temps are tempVars, and
all instance variables are CapturedVars.
Marcus
--
Marcus Denker -- denker at iam.unibe.ch
http://www.iam.unibe.ch/~denker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20070703/2e8a80fb/attachment.htm
More information about the Newcompiler
mailing list