[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Instead of pcase
From: |
Ihor Radchenko |
Subject: |
Re: Instead of pcase |
Date: |
Thu, 28 Dec 2023 13:05:34 +0000 |
Richard Stallman <rms@gnu.org> writes:
> > > (> num-foos min-foos) ; Match any number greater than MIN-FOOS,
> > > ; bind `num-foos' to it.
>
> > But this is confusing - which symbol to bind and which one to eval is
> > based purely on position in the ,(PRED ...) pattern.
>
> As this states
>
> > Constrained variable: (PRED VARIABLE) or, more generally,
> > (PRED VARIABLE OTHER-ARGS...)
>
> the pattern variable to bind is always the second element of that list
> ...
> Is it clear now what that pattern means?
> Can you suggest what aspects of that (or other) text to improve?
I did not mean that I do not understand the description of PRED form.
I just find the syntax you proposed confusing - it is too similar to the
ordinary Elisp forms. Especially when we start nesting "constrained
variable" constructs.
For example, consider matching a list of two integers where the second
element is both larger than the first and also divisible by 5 when
subtracted variable DEC:
`(,(integerp smaller) ,(> (= (mod (- (integerp bigger) dec) 5) 0) smaller))
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- cond*, (continued)
- Re: Instead of pcase, Richard Stallman, 2023/12/15
- Re: Instead of pcase, Adam Porter, 2023/12/16
- Re: Instead of pcase, Richard Stallman, 2023/12/19
- Re: Instead of pcase, Adam Porter, 2023/12/20
- Re: Instead of pcase, Richard Stallman, 2023/12/22
- Re: Instead of pcase, Ihor Radchenko, 2023/12/25
- Re: Instead of pcase, Richard Stallman, 2023/12/26
- Re: Instead of pcase,
Ihor Radchenko <=
- Re: Instead of pcase, Richard Stallman, 2023/12/29
- Re: Instead of pcase, Richard Stallman, 2023/12/22
- Re: Instead of pcase, Richard Stallman, 2023/12/12
- Re: Instead of pcase, Richard Stallman, 2023/12/10