Hi,

I have quite some problems with the scope of local variables. The following
script does point it out:

--------------------------------------
REBOL []

local-func: function [input][my-local-string][
  my-local-string: "that is local "
  print append my-local-string input
]

local-func "Call 1"
local-func "Call 2"

print my-local-string
        
-------------------------------------

raimund@linux:~/Development/rebol/Tests > rebol test_locals.r
that is local Call 1
that is local Call 1Call 2
** Script Error: my-local-string has no value.
** Where: print my-local-string
>>  


The results suggest that locals are handled like static vars in C is that
correct? Why does the assignemnt to my-local-string at the start of the
local-func not inititalize the local?

Can anyone point me to some more info about this issue?

Thanx

Raimund 


<---------------------------------------------> 
42 war schon immer einge gute Antwort;-))

Reply via email to