From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: uninterned symbols as Tree-IL constants
Date: Sun, 21 Aug 2011 19:17:07 +0200 [thread overview]
Message-ID: <87liumu1kc.fsf@gnu.org> (raw)
In-Reply-To: 87zkj2vkvm.fsf@olor.terpri.org
Hi,
BT Templeton <bpt@hcoop.net> skribis:
> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Hi,
>>
>> BT Templeton <bpt@hcoop.net> 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’.
prev parent reply other threads:[~2011-08-21 17:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-21 0:20 uninterned symbols as Tree-IL constants BT Templeton
2011-08-21 13:25 ` Ludovic Courtès
2011-08-21 15:34 ` BT Templeton
2011-08-21 17:17 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87liumu1kc.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).