eDave:Generally variables should be set to be local by including them in a let statement. Local variables cannot be changed by users.
You may have to re-think your code if you want to protect the contents of a global variable. The documentation states that the behavior of this is not specified.
Hi Dave,
Thanks! Actually that is not a global variable, it(the defstruct variable) is passed as a function parameter. it might be Skill limitation to write protect a defstruct variable. Not sure...
Anyway, I will think about other way to protect it.
Another interesting phenomena I found is that a local variable defined in parent function is visible in its child function.
Please look at following example, cellName is visible in function testCell(), it can be printed out as "abc" when call function mytest().
It behaves differently compared with that of C language, and other script language, like Tcl. Is there any special purpose for SKILL to do so?
procedure( mytest()
prog( (cellName)
cellName = "abc"
testCell()
)
)
procedure( testCell()
prog( ()
printf("cell name is %s ...\n" cellName)
)
)
Thanks,
Angelia