[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase without code duplication
From: |
Stefan Monnier |
Subject: |
Re: pcase without code duplication |
Date: |
Fri, 23 Apr 2021 00:01:30 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Can one also use nil as option in pcase. What possibilities
> exist for (_ ?
>
> e.g.
>
> (nil
If you want to match a symbol, you need to quote it:
('nil (do-something))
> ((or 0 nil)
((or 0 'nil) (do-something-else))
Of course, you can also quote the 0 if you want, tho it makes no difference.
> ((or _ nil)
This is redundant, but yes you can do
((or _ 'nil) (do-yet-another-thing))
-- Stefan