emacs-devel
[Top][All Lists]
Advanced

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

Re: cond*


From: Richard Stallman
Subject: Re: cond*
Date: Sat, 23 Dec 2023 22:57:53 -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. ]]]

  > > Are you talking about this?
  > >
  > >    (cond*
  > >        ((match* `(expt ,foo ,bar) x))
  > >        (t
  > >             (something-that-depends-on FOO BAR) ; is this how to use it?
  > >        )

  > Yes.  It is very simple.  In Elisp or any Lisp I know, forms that
  > introduce bindings are also the containers of any forms that use
  > such bindings, most notable case being (let VARLIST BODY...)

The that introduces these bindings is let, and it also contains them.
Likewise for cond*.

match* and bind* are not independent constructs -- they are defined as
part of cond*.  They are used within a cond* to specify the bindings
for it.  It is a little more complex than the way let* makes bindings
but not very different.

This is a generalization of a feature of pcase.  A pcase clause's
pattern may specify bindings that are not contained within that
pattern.  They are contained within the pcase form.

The same is true for cond*, but since it has different kinds of
clauses, match* and bind* identify clauses whose first element can
make bindings.  These bindings are specified by part of the cond* form
and contained within the cond* form.

(Formerly I proposed the keywords :match and :bind to
mark this, but it's equivalent except for 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]