[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The poor state of documentation of pcase like things.
From: |
Eli Zaretskii |
Subject: |
Re: The poor state of documentation of pcase like things. |
Date: |
Sat, 02 Jan 2016 10:16:59 +0200 |
> From: Daniel Colascione <address@hidden>
> Date: Fri, 1 Jan 2016 11:05:31 -0800
> Cc: Michael Heerdegen <address@hidden>, address@hidden
>
> >>> (pcase skip
> >>> (`nil nil)
> >>> (`0 t)
> >>> (_ (setq i (+ i skip -1)) (funcall get-next-frame)))))))
> >>
> >> (cond ((null skip))
> >> ((eq skip 0) t)
> >> (t (setq i (+ i skip -1))
> >> (funcall get-next-frame)))
> >>
> >> Not much difference.
> >
> > If skip is nil, the first returns probably nil and the second t. One
> > could probably do
> >
> > (and skip
> > (or (eql skip 0)
> > (setq ...)))
> >
> > I'm not fond of eq for numeric comparisons: that's an Elispism.
>
> That's true, but I think it's too pervasive to change now, so why fight it?
Who said anything about fighting? I just asked if there was anything
there that I was missing.
Now that I know there isn't, I can convert such code to using 'cond'
whenever I feel like it. Like we do with whitespace changes.
Thanks.
- 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, 2016/01/01
- 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 <=
- 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
- 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., Michael Heerdegen, 2016/01/02
- Re: The poor state of documentation of pcase like things., David Kastrup, 2016/01/03
- Re: The poor state of documentation of pcase like things., Clément Pit--Claudel, 2016/01/03