[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: The poor state of documentation of pcase like things.
From: |
Drew Adams |
Subject: |
RE: The poor state of documentation of pcase like things. |
Date: |
Fri, 1 Jan 2016 07:18:47 -0800 (PST) |
> Btw, could someone please tell what are the benefits of using 'pcase'
> in snippets like this one:
>
> (pcase skip
> (`nil nil)
> (`0 t)
> (_ (setq i (+ i skip -1)) (funcall get-next-frame)))))))
>
> How is this different from using 'cond' in trivial ways?
>
> (I see quite a few of such uses of 'pcase' in the sources, and when I
> read them, I always wonder what is it that I'm missing about that
> code.)
FWIW, I noticed the same thing a while ago. Seems like someone
went on a `pcase' rampage, or perhaps was just overly enthusiastic
with a new toy. ("Ooooh - shiny!")
We should use `pcase' when it really helps, including helps make
reading the code easier. And hopefully some real use of pattern
matching would typically be involved (i.e., decomposition, not
just matching `nil' or `0' or "abc" literally).
- Re: The poor state of documentation of pcase like things., Eli Zaretskii, 2016/01/01
- RE: The poor state of documentation of pcase like things.,
Drew Adams <=
- Re: The poor state of documentation of pcase like things., John Wiegley, 2016/01/01
- Re: The poor state of documentation of pcase like things., David Kastrup, 2016/01/01
- Re: The poor state of documentation of pcase like things., Daniel Colascione, 2016/01/01
- Re: The poor state of documentation of pcase like things., Eli Zaretskii, 2016/01/02
- Re: The poor state of documentation of pcase like things., David Kastrup, 2016/01/02
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2016/01/02
- RE: The poor state of documentation of pcase like things., Drew Adams, 2016/01/02
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2016/01/02
- RE: The poor state of documentation of pcase like things., Drew Adams, 2016/01/02
- Re: The poor state of documentation of pcase like things., Michael Heerdegen, 2016/01/03