[Top][All Lists]

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

Re: Improving aesthetics & readability of backquote

From: Stefan Monnier
Subject: Re: Improving aesthetics & readability of backquote
Date: Sun, 19 May 2019 23:38:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Then it would be a case of augmenting the "unquote" ,VAR and "splice" ,@VAR
> reader constructs:
>    (quoteval (1 2 (unquote a) 5 (splice b) 8 ))
>    -> (1 2 (3 4) 5 6 7 8)

You'd feel quite at home in Scheme where the reader's

    'E  =>  (quote E)
is complemented by

    `E  =>  (quasiquote E)
    ,E  =>  (unquote E)
    ,@E =>  (unquote-splicing E)

Elisp doesn't have that, mostly for historical reasons, I think.
I haven't been able to confirm it, but I believe the road looked like:
the Elisp reader originally only had the `quote` special element and
since people don't like to write (backquote (foo bar (unquote baz))),
they started writing (` (foo bar (, baz))) which was at least vaguely
reminiscent of the "normal" backquote/unquote used in other Lisps.
This is the "old-style" quotes.  When the new-style quotes were added
to the reader (those that look like regular Lisp) it was natural to map

    `E  =>  (` E)

so that the existing definition of the ` macro worked both with the new
and with the old syntax.


reply via email to

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