From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#23550: 25.0.93; cl.texi (for var on list by func): Fix documentation Date: Tue, 17 May 2016 00:49:02 +0900 (JST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1463414810 25419 80.91.229.3 (16 May 2016 16:06:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 May 2016 16:06:50 +0000 (UTC) To: 23550@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 16 18:06:39 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1b2L2R-00018f-4i for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 May 2016 18:06:35 +0200 Original-Received: from localhost ([::1]:44687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2L2Q-0006Q6-Gy for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 May 2016 12:06:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Kjb-0002ye-1D for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:47:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2KjW-0000ZD-Sm for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:47:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2KjW-0000Z8-OG for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b2KjW-0001Fs-JE for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 May 2016 15:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23550 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14634135621864 (code B ref -1); Mon, 16 May 2016 15:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 May 2016 15:46:02 +0000 Original-Received: from localhost ([127.0.0.1]:53929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2KiX-0000Ti-SY for submit@debbugs.gnu.org; Mon, 16 May 2016 11:46:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2KiW-0000Ox-VA for submit@debbugs.gnu.org; Mon, 16 May 2016 11:46:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2KiQ-0000Lw-OE for submit@debbugs.gnu.org; Mon, 16 May 2016 11:45:55 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2KiQ-0000Ll-Am for submit@debbugs.gnu.org; Mon, 16 May 2016 11:45:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2KiO-0000sI-1J for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:45:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2KiI-0000KP-Ow for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:45:50 -0400 Original-Received: from calancha-ilc.kek.jp ([130.87.234.234]:60097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2KiI-0000KG-EQ for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:45:46 -0400 Original-Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id 2B0FC640F; Tue, 17 May 2016 00:49:02 +0900 (JST) Original-Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 14EAC5646 for ; Tue, 17 May 2016 00:49:02 +0900 (JST) X-X-Sender: calancha@calancha-ilc.kek.jp User-Agent: Alpine 2.20 (LRH 67 2015-01-07) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118286 Archived-At: * doc/misc/cl.texi (for var on list by func): Fix documentation 'cl-loop for var on list by func' behaves as in CL: 'on' expression need to be a list. The following tests run in the *scratch* buffer return same values as in SBCL: ;; CL cl-loop -> loop emacs -Q: (require 'cl-lib) (setq preys '("grass" "lion" "rabbit")) (defun next-prey (x) "Return the name of the prey of animal X." (cl-loop while (not (atom x)) do (setq x (car x))) (cond ((member x preys) ; elisp ;; (cond ((member x preys :test #'string=) ; CL (cond ((string= x "lion") "rabbit") ((string= x "rabbit") "grass") (t nil))) (t nil))) (defun next-prey-list (x) "Return a list with the name of the prey of animal X." (let ((res (next-prey x))) (if res (list res) nil))) [A] (mapcar 'next-prey '("grass" "lion" "rabbit")) [B] (mapcar 'next-prey-list '("grass" "lion" "rabbit")) [A] (nil "rabbit" "grass") [B] (nil ("rabbit") ("grass")) [I] (cl-loop for y on preys collect y) [II] (cl-loop for y on preys by #'next-prey collect y) [III] (cl-loop for y on (car preys) by #'next-prey collect y) [IV] (cl-loop for y on (car preys) by #'next-prey-list collect y) [V] (cl-loop for y on preys by #'next-prey-list collect y) [I] (("grass" "lion" "rabbit") ("lion" "rabbit") ("rabbit")) [II] (("grass" "lion" "rabbit")) [III] nil [IV] nil [V] (("grass" "lion" "rabbit")) In GNU Emacs 25.0.93.3 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30) Repository revision: 6de0715f5467d4b925e2dfe082174529ace3b174 >From 3e1756fb4d76e34b74b96782d4509582e9ce0cd3 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 17 May 2016 00:04:56 +0900 Subject: [PATCH] ; * cl.texi (clause 'for' with 'on'): Fix documentation --- doc/misc/cl.texi | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 4137a95..319592c 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -1956,18 +1956,6 @@ For Clauses @result{} ((1 2 3 4) (2 3 4) (3 4) (4)) @end example -With @code{by}, there is no real reason that the @code{on} expression -must be a list. For example: - -@example -(cl-loop for x on first-animal by 'next-animal collect x) -@end example - -@noindent -where @code{(next-animal x)} takes an ``animal'' @var{x} and returns -the next in the (assumed) sequence of animals, or @code{nil} if -@var{x} was the last animal in the sequence. - @item for @var{var} in-ref @var{list} by @var{function} This is like a regular @code{in} clause, but @var{var} becomes a @code{setf}-able ``reference'' onto the elements of the list -- 2.8.1