> on the closure related note, what is perhaps interesting in a workspace is
>
> values := (1 to: 5) collect: [:each | [each] ].
> values collect: [:each | each value]
> --> #(1 2 3 4 5)

That's correct.

> | i |
> values := (1 to: 5) collect: [:each |
>                        i := each.
>                        [i] ].
> values collect: [:each | each value]
> -->#(5 5 5 5 5)

That behavior is correct. i is defined outside the block, thus it
refers to the current number which is 5.

> values := OrderedCollection new.
> 1 to: 5 do: [:i | values add: [i] ].
> values collect: [:each | each value]
> --> an OrderedCollection(6 6 6 6 6)

That's a bug, but already fixed by Eliot. I don't know why the patch
is not included with the image? Load the attachement.

The two other failing tests are actually failing in most Smalltalk,
even in commercial ones.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch

Attachment: TempVariableNode-analyseClosure.st
Description: Binary data

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to