[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase-dolist
From: |
Michael Heerdegen |
Subject: |
Re: pcase-dolist |
Date: |
Wed, 08 Jul 2015 22:50:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Artur Malabarba <address@hidden> writes:
> Only if you make them like this. The idea of `(if-let ((a expr))
> body)' is that evaluate `expr' and, if it is non-nil, bind it to a and
> run `body'. This doesn't exclude the possibility of `a' being a pcase
> pattern. Just make sure that the the check for nil expr is done as a
> separate thing, before the pattern matching.
I don't know if I would like that semantic. It doesn't sound intuitive
to me.
> If you implement pcase-if-let the way you suggest above, isn't that
> just the same as pcase?
For one binding, yes. The body would be at a more prominent place
though.
Isn't if-let not just pcase as well?
(if-let ((var expr)) then else)
(pcase expr ((and var (guard var)) then) (_ else))
Michael.
- Re: pcase-dolist, (continued)
- Re: pcase-dolist, Stefan Monnier, 2015/07/09
- Re: pcase-dolist, Michael Heerdegen, 2015/07/09
- Re: pcase-dolist, Stefan Monnier, 2015/07/10
- Re: pcase-dolist, Tassilo Horn, 2015/07/10
- Re: pcase-dolist, Stefan Monnier, 2015/07/10
- Re: pcase-dolist, Artur Malabarba, 2015/07/08
- Re: pcase-dolist,
Michael Heerdegen <=