From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: The poor state of documentation of pcase like things. Date: Sat, 02 Jan 2016 10:16:59 +0200 Message-ID: <83fuygcs5g.fsf@gnu.org> References: <20151216202605.GA3752@acm.fritz.box> <87io3m60bq.fsf@web.de> <877fk1nnk0.fsf@web.de> <8760zlue3j.fsf@gmail.com> <87vb7kajgv.fsf@web.de> <83y4c9ag06.fsf@gnu.org> <87bn95m9eg.fsf@fencepost.gnu.org> <5686CDFB.2010105@dancol.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1451722637 26916 80.91.229.3 (2 Jan 2016 08:17:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jan 2016 08:17:17 +0000 (UTC) Cc: michael_heerdegen@web.de, dak@gnu.org, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 02 09:17:12 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aFHN9-0001QZ-4L for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2016 09:17:11 +0100 Original-Received: from localhost ([::1]:37724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFHN8-0003Dj-Id for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2016 03:17:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFHN5-0003Dc-Fi for emacs-devel@gnu.org; Sat, 02 Jan 2016 03:17:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFHN1-0007vL-FC for emacs-devel@gnu.org; Sat, 02 Jan 2016 03:17:07 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFHN1-0007vH-Br; Sat, 02 Jan 2016 03:17:03 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1240 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aFHN0-0003xm-DK; Sat, 02 Jan 2016 03:17:02 -0500 In-reply-to: <5686CDFB.2010105@dancol.org> (message from Daniel Colascione on Fri, 1 Jan 2016 11:05:31 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197346 Archived-At: > From: Daniel Colascione > Date: Fri, 1 Jan 2016 11:05:31 -0800 > Cc: Michael Heerdegen , emacs-devel@gnu.org > > >>> (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.