emacs-devel
[Top][All Lists]
Advanced

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

Re: Instead of pcase


From: Stefan Monnier
Subject: Re: Instead of pcase
Date: Fri, 24 Nov 2023 23:15:14 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>   > To interpret those backquotes and commas, one can imagine that the they
>   > do the inverse of the usual.
> I uderstand that when you say it, but when I saw the line
>
>          (`(,hookfun . (,start ,end ,collection . ,plist))
>
> I was not sure which part of the line that rule applies to.

Interesting.  I find this one to be very straightforward.
The previous line with the `and` and the `pred` is the more problematic one.

> In particular, what is the reason for the period and inner
> parenthsses?

Because (HOOKFUN . VALUE) is what is returned by the `run-hook-wrapped`
function and (,START ,END ,COLLECTION . ,PLIST) is the format of the
value returned by the hook's functions.
IOW, a merely stylistic choice.

>  Why doesn't the code say this?
>
>          (`(,hookfun ,start ,end ,collection . ,plist)
>
> Would that be equiva;ent?

Interesting.  `pcase` is a macro, so it does not see the above
characters, it only sees the resulting Sexp returned by the Lisp reader,
and as you may remember, the reader returns *exactly* the same Sexp
for the above two lines of text.
So `pcase` would be hard pressed to make those two *not* equivalent :-)


        Stefan




reply via email to

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