Do symbols need to be EQ?

Anton Vodonosov avodonosov at yandex.ru
Fri Jul 3 09:15:32 UTC 2015


A note about "philosophical problems" - if one wants to build
a compact mental model, reasonable and consistent with all
the Common Lisp properties, there probably may be more than
one way to do so, and neither of possible models can be proven incorrect.

03.07.2015, 11:16, "Anton Vodonosov" <avodonosov at yandex.ru>:
> I personally don't think that name CL-USER::FOO anyhow represents
> the "nature" of the symbol
>
> The same number may be referenced as #x20000000 and as 536870912.
> It's just a way to refer the object, not the object itself.

I want to correct myself. Unlike numbers or any other objects,
symbols _are_ about names, so we can say that the name CL-USER::FOO
represents the "nature" of symbol.

I think Common Lisp wants to save memory and speedup comparison,
so when we use the same name we get the same object, as implemented
by INTERN (this trick even has name - the Flyweight pattern).

So, this is just an optimization trick, and UNITERN is a maintenance,
system tool, not designed to express programs. We are encouraged to
operate as if the symbol name means the same object.




More information about the pro mailing list