Hi,

BT Templeton <[email protected]> skribis:

> [email protected] (Ludovic Courtès) writes:
>
>> Hi,
>>
>> BT Templeton <[email protected]> skribis:
>>
>>> I noticed that when uninterned symbols are used as Tree-IL constants,
>>
>> I thought literal (constant) symbols in Elisp were interned.  You seem
>> to imply this isn’t always the case; can you explain?
>
> Since Elisp lacks hygienic macros, macros typically use uninterned
> symbols for variable names used in their expansions in order to avoid
> name clashes.

Oh, OK.  With our good ol’ defmacro, common practice was to use gensym
instead.

> There are also a couple other ways to use uninterned symbols as
> literals: you can use `eval', and Elisp supports Common Lisp's `#:foo'
> syntax. Sharpsign-colon is rare in Elisp, but potentially useful for
> testing special forms without polluting the global namespace:
>
>   (progn
>     '#1=#:foo
>     (setq #1# 42)
>     #1#) ; => 42

Hmm, thanks for explaining.

Then yes, it makes sense to add a VM instruction for uninterned symbols
(it should be at the end of the instruction list to avoid polluting the
native instruction cache.)

Feel free to submit the patch if you want it to be applied to ‘master’.

Thanks,
Ludo’.


Reply via email to