emacs-devel
[Top][All Lists]
Advanced

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

Re: Instead of pcase


From: Lynn Winebarger
Subject: Re: Instead of pcase
Date: Fri, 24 Nov 2023 12:29:12 -0500

On Mon, Nov 20, 2023, 9:42 PM Richard Stallman <rms@gnu.org> wrote:

  > > They contain code that looks like Lisp but does not have the same
  > > semantic rules as Lisp.

  > Yes: it's a domain-specific language.

THat is why pcase adds to the total complexity of Emacs Lisp: because
it incorporates a domain-specific language.  (I called it a "little
lajguage".)

  > 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.

In particular, what is the reason for the period and inner
parenthsses?  Why doesn't the code say this?

>          > (`(,hookfun ,start ,end ,collection . ,plist)

Would that be equiva;ent?

I could not assume the inner parenthsses were unnecessary.  Maybe
there was a conventiob by which they change the meaning.
I did not know.

I haven't seen anyone point this out yet, but they have to be equivalent.  The reader constructs the same data structure for those concrete expressions (text) before the pcase macro is ever evaluated.  

I would think the author is simply emphasizing that they are parsing an entity in an association list for which hookfun is a key.

Lynn


reply via email to

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