emacs-devel
[Top][All Lists]
Advanced

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

Re: Code for cond*


From: Richard Stallman
Subject: Re: Code for cond*
Date: Fri, 26 Jan 2024 22:35:56 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

In pcase, all the patterns have to match one and the same datum.  I've
designed cond* so that each pattern-matching specifies a datum to
match the pattern to.  That is an advance.

But it could be convenient not to have to respecify the datum each time
when it is the same datum.

With the crrenbt cond* syntax, a way to say "use the same datum: could
be, by omitting the DATUM from the match* subform to reuee the datum
of the previous match* subform, like this:

  (cond* ((match* P1 foo) ...)
         ((match* PX) :no-exit)
         ((match* P2) ...)
         ((match* P3) ...)
         ((match* P4 bar) ...))

For the alternate keyword-based cond* synax, there could be a keyword
to specify a datum for subsequent matches.

  (cond* :datum foo
         ;; Next 4 match agains foo.
         (:match P1 ...)
         :match PX
         (:match P2 ...)
         (:match P3 ...)
         :datum bar
         (:match P4 ...))

I'm interested in feedback about this possible additional feature
in each of the two forms of syntax.



-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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