[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replace trivial pcase occurrences in the Emacs sources
From: |
Michael Heerdegen |
Subject: |
Re: Replace trivial pcase occurrences in the Emacs sources |
Date: |
Wed, 24 Oct 2018 17:48:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
> I agree with the "trivial" part, but why cl-case and not cond (with
> the same "trivial" caveat)?
Just because `cl-case' fits better? - for an equivalent rewrite using
`cond', I need to define an extra local variable to bind the treated
value to, event a name for it (we speak about ~ 300 cases!) and all cond
branches would look equally like (eq VAR 'VAL). Not an improvement in
readability in my mind.
There is a minority (around ~ 20 cases) that look like
(pcase EXPR
('X1 foo1)
('X2 foo2)
...
(VAR EXPR-USING-THE-VAR))
with a catchall last branch that already use a variable binding. These
would fit a bit better to `cond', but as said, that's a minority.
Michael.
- Re: Replace trivial pcase occurrences in the Emacs sources (was: The poor state of documentation of pcase like things.), (continued)
- Re: Replace trivial pcase occurrences in the Emacs sources (was: The poor state of documentation of pcase like things.), Eli Zaretskii, 2018/10/23
- Re: Replace trivial pcase occurrences in the Emacs sources, Stefan Monnier, 2018/10/23
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/23
- Re: Replace trivial pcase occurrences in the Emacs sources, Stefan Monnier, 2018/10/23
- pcase vs. case (where it could also be used) [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Garreau\, Alexandre, 2018/10/23
- Re: pcase vs. case (where it could also be used) [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Stefan Monnier, 2018/10/23
- Re: pcase vs. case (where it could also be used) [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Garreau\, Alexandre, 2018/10/23
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources,
Michael Heerdegen <=
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources, Garreau\, Alexandre, 2018/10/24
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/27
- Re: Replace trivial pcase occurrences in the Emacs sources, Garreau\, Alexandre, 2018/10/27
- Re: Replace trivial pcase occurrences in the Emacs sources, Dmitry Gutov, 2018/10/27
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/27
- Re: Replace trivial pcase occurrences in the Emacs sources, Garreau\, Alexandre, 2018/10/27
- pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Garreau\, Alexandre, 2018/10/27