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: Daniel Colascione
Subject: Re: The poor state of documentation of pcase like things.
Date: Fri, 1 Jan 2016 11:05:31 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

On 01/01/2016 10:39 AM, David Kastrup wrote:
> John Wiegley <address@hidden> writes:
> 
>>>>>>> Eli Zaretskii <address@hidden> writes:
>>
>>>      (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?

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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