emacs-devel
[Top][All Lists]
Advanced

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

Re: The poor state of documentation of pcase like things.


From: Michael Heerdegen
Subject: Re: The poor state of documentation of pcase like things.
Date: Sun, 03 Jan 2016 04:21:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Drew Adams <address@hidden> writes:

> Just one opinion, of course.

I think I do the same most of the time.

Probably some examples of pcase in the sources are not good code, and
not good examples of how work with pcase.  You can write good and bad
pcase code, code that emphasizes what it's doing, and code that looks
more like the result of a mechanical replacement.  Maybe the latter is
the case for a lot of places in the sources.

But I think I agree to the goal to use cl-case where possible.  cond is
a bit different, since it is as powerful as pcase (in principle), so
when you see a cond, you can't assume much about what is (not) done
there.  pcase is not only useful when destructuring is involved (though
it is the most important feature).

The often cited case of a long list of conditions that only tests for
equality for a longer list of symbols is a good example, but also an
extreme one, because this is a case that doesn't appear so often in
practise.

Oh, and I also think there are a lot of places in the sources that would
get simpler when using pcase.


Michael.




reply via email to

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