Hi Jon,

> I got a little surprised when I discovered that property
> manipulations on a "local" symbol, e.g. inside a 'let' block, had
> "global" effects, like in this example:
> ...
> I understand this is probably the way it's supposed to be, but I


You should keep in mind that in PicoLisp _all_ internal symbols are
always global. Only the bindings of values are handled by 'let' and
related functions. The symbol itself (i.e. the pointer to the cell in
memory), its properties and the symbol name are not influenced by that.

There is nothing like a "local" symbol (except for transient symbols,
but they are local to the source file, not to the binding environment).

> wasn't prepared. I have very little knowledge about other Lisps, so
> I don't know whether properties is a common concept in other Lisps,

Yes, it is. Properties had been there since the earliest Lisps, afaik.

> or how properties are used. I only know PicoLisp uses properties in
> OO matters. Can this global nature of properties ever represent a
> problem when working with Classes and Objects in PicoLisp?

I don't think so. As I said, not properties are the problem, but the
symbols themselves. OOP usually uses anonymous symbols (typically
created with 'new'). So if you create a local symbol

   (let S (new '(+MyClass) ...)
      ... )

then it will never interfer with any other symbol.

BTW, this situation is analog to structures in C, or objects in any
other language. If you create a global structure, its elements
(properties) are also global. If you create a structure with malloc() or
have it automatically allocated on the stack, they are not.

- Alex
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to