Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
ArtistA beautiful purple-haired woman wearing a long purple velvet ankle-length dress with flouncy sleeves and purple suede high heels. She is writing a list of items on the blackboard.
Normally we declare all our local variables in a block at the beginning of a procedure, thus :
Foo <:: { (a=1, b, c, pi=3.14159); ... etc ...
This builds a local buf on the stack, with a symbol table as row [0] and the values as row [1]. However, we may also declare and use local variables as we go :
Foo <:: { (a=1, b, c); ... etc ...
pi <:: 3.14159; ... etc ...
What happens here is that the buf holding the local variables is dynamically appended to, as if we had written
locals << pi;
or whatever. Thus we can keep local variables close to the place where they are used in the procedure. Note that if we use a variable before we have given it an initial value, the system gives it the special value NaN (not-a-number) or "undef". This has the internal value $EF, and causes a trap if used in an expression, catchable by an event handler {? UNDEF : mytrap ?}.