[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase-if-let?
From: |
Michael Heerdegen |
Subject: |
Re: pcase-if-let? |
Date: |
Tue, 17 Apr 2018 23:04:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Nathan Moreau <address@hidden> writes:
> (pcase-if
> ((`(,q . ,r) '())
> (`(,s . ,u) '(b c)))
> (list q r s u 'ok)
> 'nope)
> => nil
>
>
> ?
> I would have expected 'nope instead.
Sure, good catch. There's a catchall rule missing in my implementation
that evaluates the else forms when matching fails (like above).
A better implementation would probably more look like that of
`pcase-let*'. Seems I already get something like pcase-if when I change
the pcase--dontcare rule in `pcase--let*'.
Thanks,
Michael.