[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Double unquote/unquote-splicing
From: |
Stefan Monnier |
Subject: |
Re: Double unquote/unquote-splicing |
Date: |
Mon, 04 Nov 2013 13:33:15 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>> 2- Since we don't allow (\` (a (\, 1 2 3))), it's weird to allow
>> ``(a ,,@x) since one possible expansion for it when x=(1 2 3) is
>> (\` (a (\, 1 2 3))).
>> Another way to say it is that we should allow (\, 1 2 3) and (\,@
>> 1 2 3), but that can't be used with the ,e and ,@e syntax, so it'll
>> stay as a second-rate citizen.
> This is incorrect. ``(a ,,@x) where x=(1 2 3) would evaluate to
> (\` (a (\, 1) (\, 2) (\, 3))). The first comma in ,,@ has the effect of
> being applied member-wise to each element spliced out of ,@. Cf. CLHS
> `Backquote' (http://www.lispworks.com/documentation/HyperSpec/Body/02_df.htm).
This is even worse since it means that the expansion of ,@foo depends on
the context.
> I believe so. (FWIW, I don't think it's that easy to tell, though I'm
> not great at this.
Back to problem nb 1, eh?
> "The backquote syntax was particularly powerful when nested. This
> occurred primarily within macro-defining macros; because such were coded
> primarily by wizards, the ability to write and interpret nested
> backquote expressions was soon surrounded by a certain mystique. Alan
> Bawden of MIT acquired a particular reputation as backquote-meister in
> the early days of the Lisp Machine." - "The Evolution of Lisp", Gabriel,
> Steele.
That sounds about right: it's only for wizards.
Nested backquotes were largely broken in Elisp and it took many years
for someone to notice. I do use them occasionally, but only in fairly
simple ways. The resulting code is largely impenetrable, so I don't
want to encourage it.
Stefan
- Double unquote/unquote-splicing, Nathan Trapuzzano, 2013/11/04
- Re: Double unquote/unquote-splicing, Stefan Monnier, 2013/11/04
- Re: Double unquote/unquote-splicing, Nathan Trapuzzano, 2013/11/04
- Re: Double unquote/unquote-splicing, Nathan Trapuzzano, 2013/11/04
- Re: Double unquote/unquote-splicing,
Stefan Monnier <=
- RE: Double unquote/unquote-splicing, Drew Adams, 2013/11/04
- Re: Double unquote/unquote-splicing, Nathan Trapuzzano, 2013/11/04
- Re: Double unquote/unquote-splicing, Stefan Monnier, 2013/11/04
- Re: Double unquote/unquote-splicing, Nathan Trapuzzano, 2013/11/05
- Re: Double unquote/unquote-splicing, Stefan Monnier, 2013/11/05
- Re: Double unquote/unquote-splicing, Stephen J. Turnbull, 2013/11/04
- Re: Double unquote/unquote-splicing, Nathan Trapuzzano, 2013/11/05
- Re: Double unquote/unquote-splicing, Stephen J. Turnbull, 2013/11/05