emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Code in lisp reader and ,.


From: Michael Welsh Duggan
Subject: Code in lisp reader and ,.
Date: Thu, 09 Feb 2012 16:17:26 -0500
User-agent: Gnus/5.11002 (No Gnus v0.20) Emacs/24.0.93 (gnu/linux)

So, in common lisp, ,. is special in quasiquoted forms.  It is supposed
to work the same as ,@, except that ,. is a hint to the compiler that
the argument to ,. may be destructively modified.  Hence given:

  (setq foo '(a b) bar '(c d))
  (setq baz `(x ,@foo y ,.bar z))

baz will be (x a b y c d z), foo will be (a b), and bar could be
anything under the sun, but is probably either (c d) or (c d z), where
(eq bar (cddddr baz)) ==> t.

Now, emacs lisp's backquote macro does not handle the ,. form.  However,
the lisp reader does treat ,. specially:  `,.foo ==> (\,\. foo).

I suggest that either emacs lisp's backquote macro be modified to handle
,. (most simply by treating it as an alias of ,@), or the special
handling for it (lread.c:2838) should be removed.

-- 
Michael Welsh Duggan
(address@hidden)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]