Hello,
I noticed this change described bellow and I just want to have
confirmation about it:
The new Pharo 2.0 compiler need to have variable assigned with a value
before it used in a recursive bloc of code. Of course it is a bit
inelegant. Or is it something else and does it need to be reported?
Thanks to let me know
Hilaire
For example this Dr. Geo code break in Pharo 2.0:
| triangle c |
triangle := [:s1 :s2 :s3 :n |
c segment: s1 to: s2;
segment: s2 to: s3;
segment: s3 to: s1.
n > 0 ifTrue:
[triangle
value: s1
value: (c middleOf: s1 and: s2) hide
value: (c middleOf: s1 and: s3) hide
value: n-1].
[...]
].
It must be changed to:
| triangle c |
triangle := []. <= CHANGE HERE
triangle := [:s1 :s2 :s3 :n |
c segment: s1 to: s2;
segment: s2 to: s3;
segment: s3 to: s1.
n > 0 ifTrue:
[triangle
value: s1
value: (c middleOf: s1 and: s2) hide
value: (c middleOf: s1 and: s3) hide
value: n-1].
[...]
].
--
Dr. Geo -
http://drgeo.euiStoa -
http://istao.drgeo.eu