From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: uninterned symbols as Tree-IL constants Date: Sun, 21 Aug 2011 19:17:07 +0200 Message-ID: <87liumu1kc.fsf@gnu.org> References: <87ei0fwr7s.fsf@olor.terpri.org> <87mxf2x5fh.fsf@gnu.org> <87zkj2vkvm.fsf@olor.terpri.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1313947049 8210 80.91.229.12 (21 Aug 2011 17:17:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 21 Aug 2011 17:17:29 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Aug 21 19:17:25 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QvBeF-0000Sw-QD for guile-devel@m.gmane.org; Sun, 21 Aug 2011 19:17:23 +0200 Original-Received: from localhost ([::1]:46924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvBeE-0000tu-Vs for guile-devel@m.gmane.org; Sun, 21 Aug 2011 13:17:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvBeD-0000to-Gy for guile-devel@gnu.org; Sun, 21 Aug 2011 13:17:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvBeC-0002YX-CV for guile-devel@gnu.org; Sun, 21 Aug 2011 13:17:21 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:54007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvBeC-0002YR-66 for guile-devel@gnu.org; Sun, 21 Aug 2011 13:17:20 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QvBeA-0000Qh-BY for guile-devel@gnu.org; Sun, 21 Aug 2011 19:17:18 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Aug 2011 19:17:18 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Aug 2011 19:17:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Fructidor an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:O/66uLjbmGktNfyxcfs3jCu9eMk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12714 Archived-At: Hi, BT Templeton skribis: > ludo@gnu.org (Ludovic Courtès) writes: > >> Hi, >> >> BT Templeton 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’.