Hi Edwin,

> the effect of (====) is that it clears the transient index.

Yes, but this function is in fact normally not called explicitly.

> how then does the interpreter find the correct one to achieve the "as
> identifiers with a limited access scope (like, for example, static
> identifiers in the C language family) " feature as pointed out in the
> reference after calling (====)?

This refers to the fact that the functionality of '====' is called
internally by 'load', before and after the contents of a file are
executed. As a result, all transient symbols in that file are not
accessible by name from outside of that file.

That's similar to static identifiers in C. If you write in one file

   static int foo;

then 'foo' will be valid only within that file's scope. If the name
'foo' is used in some other source file, it will refer to a different
memory location.

In the same sense in PicoLisp, "foo" in one source file will be a
different symbol (and thus memory location (value and property list))
from "foo" in another source file.

There is no magic involved. This is simply a result of maintaining a
file-local transient symbol lookup. A C compiler will do very similar
things, by putting all 'static' names into a symbol table valid only in
the context of the current source file (if we regard the set of
'#include'd files as a single source file, as 'include' involves only a
textual insertion).

- Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to