Hi again,

It's the latter that is true. The garbage collector can collect any
variable that is not reachable anymore from any code (statement) that still
has to be run. Hence, after %(A), the variable E(M) can indeed be
collected. But that's assuming that garbage collection does run at this
point, of course.

Sébastien

On Wed, Apr 11, 2012 at 20:22, Enrique Iurleo <quiquewol...@gmail.com>wrote:

> Well a new doubt and i hope the last haha.. how exactly work the garbage
> collector in OZ? i mean.. for collect a variable in the SAS look if there's
> a environment on the stack that references the variable or look the code in
> the stack that references the variable? i mean.. for example:
>
> local X R M P Q Y in
>     M=proc{$ X Res}
>             Res = proc{$ Y}
>                           Y = X
>                       end
>          end
>     {M X P}
>     {M Y Q} <------------------- %(A)
>     R = P
>     X = 2
>     {R X}
>
> after execute the point %(A) the garbage collector will collect the
> variable E(M) in the SAS because the variable will not use late? or can
> collect the variable beacause the environment of the other statements still
> have the identifier M bound to E(M)?
>
> I mean.. the garbage collector look if the environments in the stack still
> references the variable? or look if in the stack theres some statements
> that uses or not the variable?
>
> Sorry if is hard to understand haha
>
_________________________________________________________________________________
mozart-users mailing list                               
mozart-users@mozart-oz.org
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to