[REBOL] [ core ] /local refinement not cleared?!
From: rebolinth:nodep:dds:nl at: 3-Apr-2002 23:26
Hello All,
Im doing a simple test on the rebol/core 2.5.0.9.1.
On the core-shell prompt i do :>
>>tst: ""
== ""
>>tst
== ""
>>tst: ""
== ""
>>loop 5 [ insert tst " A " ]
== " A A A A "
>>tst
== " A A A A A "
>>tst: ""
== ""
>>tst
== ""
>>
As you can see above, the tst string is cleared after a tst: "" at the end.
Well now? When im trying to do the same thing but then inside a function
and using the /local refinement inside the function, Im not able to get the
string :tester cleared.. see below :>
>>testing: func [ test-size [ integer! ]
[ /local tester
[ ] [
[ tester: ""
[ loop test-size [ insert tester " A " ]
[ tester
[ ]
>>
>>testing 5
== " A A A A A "
>>testing 5
== " A A A A A A A A A A "
>>testing 5
== " A A A A A A A A A A A A A A A "
I would expect, because of tester: "", that everytime the function gets
executed and the /local tester is set to "" by tester: ""
..which it does not??..or sould it again be me ;-) Shoot me please ;-)
Any help is welcome..
(R)egards,
Norman.