Symbol vs identifiers Shiro Kawai (12 Aug 2026 06:42 UTC)
Re: Symbol vs identifiers Artyom Bologov (12 Aug 2026 17:09 UTC)
Re: Symbol vs identifiers Shiro Kawai (12 Aug 2026 19:04 UTC)

Re: Symbol vs identifiers Artyom Bologov 12 Aug 2026 17:08 UTC

Hi Shiro,

> In R[67]RS Scheme, symbols are not imported/exported, nor are bound to values.  Having properties like symbol-library or symbol-value is
> misleading at least.
>
> (Non-quoted) symbols in the code resolve to identifiers during compilation; identifiers are what carry those properties.  An identifier can carry its
> source symbol for debugging purposes, but you can't translate a symbol to an identifier without referencing the lexical environment.
>
> Runtime reflection on identifiers is tricky.  An implementation may retain such metainformation only during the compilation/macro-expansion
> stage.   SRFI-213 (Identifier properties) provides a way to access such information, but only during macro expansion.  That means
> `inspect-properties` needs to be a macro.

Ah, yes, my Common Lisp experience playing tricks on me again 😅

> If it's for a REPL utility, though, we can take a different approach.  A procedure can try to resolve the symbol w.r.t. the REPL's top-level
> environment and return the metainformation of the resulting identifier.

Wait, does not symbol evaluation do that too?

Thanks,
--
Artyom Bologov
https://aartaka.me