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: Eli Zaretskii
Subject: Re: Replace trivial pcase occurrences in the Emacs sources
Date: Wed, 24 Oct 2018 20:35:08 +0300

> From: Michael Heerdegen <address@hidden>
> Cc: address@hidden,  address@hidden
> Date: Wed, 24 Oct 2018 17:48:50 +0200
> 
> 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.

I guess we will have to disagree about that.  At the very least, you
require people to be acquainted with cl-case well enough.

And if repeating (eq foo 'bar) is the issue, you can use assoc and a
data structure, see my other message.  Just a thought.



reply via email to

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