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: 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).



reply via email to

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