emacs-devel
[Top][All Lists]
Advanced

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

Re: Instead of pcase


From: Yuri Khan
Subject: Re: Instead of pcase
Date: Fri, 1 Dec 2023 14:07:40 +0700

On Fri, 1 Dec 2023 at 13:32, Eli Zaretskii <eliz@gnu.org> wrote:

> Incidentally, the actual code from which this were taken is
>
>       (`(,hookfun . (,start ,end ,collection . ,plist))
>
> Which has _two_ periods, not one, which are AFAIU redundant, as far as
> the Lisp reader is concerned.

The first period and the parentheses are redundant but they are
helpful because they emphasize that the first element and the rest of
the list come from different places.

The second period is not redundant. It causes the (,start ,end
,collection . ,plist) to match any list of 3+ elements and the ,plist
binding to receive the remainder. Without the period, (,start ,end
,collection ,plist) would only match a list of exactly 4 elements, and
,plist would bind to the fourth.

Maybe you are implying ,x is equivalent to (\, x) and so `(,hookfun .
(,start ,end ,collection . ,plist)) could be written `((\, hookfun)
(\, start) (\, end) (\, collection) \, plist). To me, that would be…
point-less?



reply via email to

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