[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)
- Re: Instead of pcase, (continued)
- Re: Instead of pcase, Richard Stallman, 2023/12/13
- Re: Instead of pcase, Richard Stallman, 2023/12/15
- Re: Instead of pcase, Richard Stallman, 2023/12/15
- cond*, Richard Stallman, 2023/12/17
- Re: cond*, João Távora, 2023/12/18
- Re: cond*, Richard Stallman, 2023/12/20
- Re: cond*, João Távora, 2023/12/21
- RE: [External] : Re: cond*, Drew Adams, 2023/12/21
- Re: [External] : Re: cond*, João Távora, 2023/12/21
- Re: [External] : Re: cond*, Richard Stallman, 2023/12/23
- Re: cond*,
Richard Stallman <=
- Re: cond*, Ihor Radchenko, 2023/12/21
- Re: cond*, Richard Stallman, 2023/12/23
- Re: cond*, Ihor Radchenko, 2023/12/25
- Re: cond*, Richard Stallman, 2023/12/18
- Re: cond*, João Távora, 2023/12/19
- Re: cond*, Richard Stallman, 2023/12/21
- Re: cond*, Philip Kaludercic, 2023/12/22
- Re: cond*, Richard Stallman, 2023/12/24
- Re: cond*, Philip Kaludercic, 2023/12/25
- Re: cond*, Richard Stallman, 2023/12/26