[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Update of pcase docs for the elisp manual
From: |
Michael Heerdegen |
Subject: |
Re: Update of pcase docs for the elisp manual |
Date: |
Thu, 28 Jan 2016 19:37:50 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> I understand. I'm just saying that it would be better to provide an
> example of using 'let' which actually made use of the reason for its
> introduction: binding symbols to values.
It's not easy to find an example for a usage of the let pattern that is
not too complicated and can't be replaced trivially with other patterns,
and does also make at least a bit of sense.
I maybe would suggest something like this:
--8<---------------cut here---------------start------------->8---
(pcase some-list
((and (let value (calculate-some-value))
(or (pred (member value))
(pred (assoc value))))
value))
--8<---------------cut here---------------end--------------->8---
This tests some-list whether - for a VALUE calculated and bound in a let
pattern, whether either this VALUE is a member of the argument list, or
a key in it interpreted as an alist. If it is, that value is returned.
How is the state of the documentation now? Do you need some more
contributions, or should I proofread everything?
Regards,
Michael.
- Re: Update of pcase docs for the elisp manual, (continued)
- Re: Update of pcase docs for the elisp manual, Stefan Monnier, 2016/01/23
- Re: Update of pcase docs for the elisp manual, Eli Zaretskii, 2016/01/24
- Re: Update of pcase docs for the elisp manual, Stefan Monnier, 2016/01/24
- Re: Update of pcase docs for the elisp manual, Eli Zaretskii, 2016/01/25
- Re: Update of pcase docs for the elisp manual, Stefan Monnier, 2016/01/25
- Re: Update of pcase docs for the elisp manual, Eli Zaretskii, 2016/01/26
- Re: Update of pcase docs for the elisp manual, Stefan Monnier, 2016/01/26
- Re: Update of pcase docs for the elisp manual, Michael Heerdegen, 2016/01/25
Re: Update of pcase docs for the elisp manual, Michael Heerdegen, 2016/01/25
Re: Update of pcase docs for the elisp manual, John Wiegley, 2016/01/26