emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replace trivial pcase occurrences in the Emacs sources


From: Stefan Monnier
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Fri, 26 Oct 2018 11:34:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>     (pcase this-param
>       ('edit (todo-edit-item--text))
>       ('header (todo-edit-item--text 'include-header))
>       ('multiline (todo-edit-item--text 'multiline))
>       ('add/edit (todo-edit-item--text 'comment-edit))
>       ('delete (todo-edit-item--text 'comment-delete))
>
> I have a hard time believing that there are more users who find it less
> clear than its cond+eq expansion.

BTW, I just bumped into another benefit of `pcase` for such code:

When I converted a particular cond+eq thingy yesterday, pcase gave me
a warning about redundant pattern, because indeed one of the original
`cond` branches was unreachable.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]