From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.devel Subject: Re: The poor state of documentation of pcase like things. Date: Sat, 2 Jan 2016 01:15:31 +0000 Message-ID: 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1451697384 20681 80.91.229.3 (2 Jan 2016 01:16:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jan 2016 01:16:24 +0000 (UTC) Cc: Michael Heerdegen , Eli Zaretskii , Emacs Development To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 02 02:16:23 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 1aFAnu-0003Vx-Q4 for ged-emacs-devel@m.gmane.org; Sat, 02 Jan 2016 02:16:23 +0100 Original-Received: from localhost ([::1]:37148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFAnq-0001BD-Cy for ged-emacs-devel@m.gmane.org; Fri, 01 Jan 2016 20:16:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFAnc-0001B7-Gx for emacs-devel@gnu.org; Fri, 01 Jan 2016 20:16:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFAnb-0002jw-N8 for emacs-devel@gnu.org; Fri, 01 Jan 2016 20:16:04 -0500 Original-Received: from mail-yk0-x22b.google.com ([2607:f8b0:4002:c07::22b]:35162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFAnZ-0002jT-4t; Fri, 01 Jan 2016 20:16:01 -0500 Original-Received: by mail-yk0-x22b.google.com with SMTP id x67so204444149ykd.2; Fri, 01 Jan 2016 17:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=t91Z29W5hDAvkeW4pdaDeYagVQcnTxPs3LewYnMoI7g=; b=V6nqKuJPICWRiyjEI40t3dGmXkZNJ2mzDV1gYMpiZH8LOQlH6J8v9sNdfF3LPLk73q Cv/ByGBngmcVfNg41iF0PjV+05mtHPfMp8c1sCf/8mmHbPY50gf3ixH6jIr6OZOj4eD+ 2e8gpc01BgCkIl+/uGUK/PSiJXMzx/P6msiTZtfnNAPG7f2mY9KQWk4+LcV3DafJMV6K /GNcM+Mzn5UpLZYSsXzYcgIONpwoB5snxUBdg5n0u6K2Zk3hGjR2NcPGAiSiPLdaJGt3 8iYhP5yiRFrv1fF6d/gb3XqQ+/Mo9reIPs5h7MybLJEng2rINZC/PryVHu5rp+/zPZMz B80Q== X-Received: by 10.129.53.66 with SMTP id c63mr55979310ywa.138.1451697360372; Fri, 01 Jan 2016 17:16:00 -0800 (PST) Original-Received: by 10.37.207.214 with HTTP; Fri, 1 Jan 2016 17:15:31 -0800 (PST) In-Reply-To: <87bn95m9eg.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c07::22b 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:197325 Archived-At: On 1 January 2016 at 18:39, David Kastrup wrote: > John Wiegley writes: > >>>>>>> Eli Zaretskii 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 ...))) True, but only an unintentional slip. I think the charitable interpretation is (cond ((null skip) nil) [...]) > I'm not fond of eq for numeric comparisons: that's an Elispism. That's Elisp programs for you. I'd have used zerop.