From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#6583: 23.2; cl loop macro with `and' clause Date: Thu, 08 Jul 2010 09:33:29 +1000 Message-ID: <871vbedfzq.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1278547216 30908 80.91.229.12 (8 Jul 2010 00:00:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2010 00:00:16 +0000 (UTC) To: 6583@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 08 02:00:14 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OWeXF-0006DW-Id for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Jul 2010 02:00:13 +0200 Original-Received: from localhost ([127.0.0.1]:42410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWeXE-00019F-OX for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Jul 2010 20:00:12 -0400 Original-Received: from [140.186.70.92] (port=38190 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWeWw-00014X-TW for bug-gnu-emacs@gnu.org; Wed, 07 Jul 2010 19:59:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWeWv-0000nd-RD for bug-gnu-emacs@gnu.org; Wed, 07 Jul 2010 19:59:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54462) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWeWv-0000nZ-Pt for bug-gnu-emacs@gnu.org; Wed, 07 Jul 2010 19:59:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OWe7v-0001fg-6n; Wed, 07 Jul 2010 19:34:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kevin Ryde Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Jul 2010 23:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6583 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.12785456426420 (code B ref -1); Wed, 07 Jul 2010 23:34:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jul 2010 23:34:02 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWe7u-0001fU-0c for submit@debbugs.gnu.org; Wed, 07 Jul 2010 19:34:02 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWe7s-0001fM-3i for submit@debbugs.gnu.org; Wed, 07 Jul 2010 19:34:01 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:56468) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OWe7m-0001LW-Ri for submit@debbugs.gnu.org; Wed, 07 Jul 2010 19:33:54 -0400 Original-Received: from [140.186.70.92] (port=59422 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWe7k-0005zY-UC for bug-gnu-emacs@gnu.org; Wed, 07 Jul 2010 19:33:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWe7j-0005tv-5c for bug-gnu-emacs@gnu.org; Wed, 07 Jul 2010 19:33:52 -0400 Original-Received: from mailout2-6.pacific.net.au ([61.8.2.229]:35937 helo=mailout2.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWe7i-0005tN-Ja for bug-gnu-emacs@gnu.org; Wed, 07 Jul 2010 19:33:51 -0400 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 816A5223246 for ; Thu, 8 Jul 2010 09:33:46 +1000 (EST) Original-Received: from blah.blah (ppp2EFE.dyn.pacific.net.au [61.8.46.254]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id A60838C0A for ; Thu, 8 Jul 2010 09:33:45 +1000 (EST) Original-Received: from gg by blah.blah with local (Exim 4.72) (envelope-from ) id 1OWe7N-0007AE-Dh for bug-gnu-emacs@gnu.org; Thu, 08 Jul 2010 09:33:29 +1000 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 07 Jul 2010 19:34:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38294 Archived-At: Evaluating (require 'cl) (loop for elem in '(1 2 3) for k = elem and j = 99 do (print k)) shows 1 1 2 where I thought it might be 1 2 3 I'm don't know much about the cl loop macro but thought the `for k' step would be evaluated after the `for elem' step, "sequential" per the cl info manual near the end of "For Clauses" If you include several `for' clauses in a row, they are treated sequentially The 1,2,3 is what you get from pasting the same form into clisp, if that suggests what an actual common lisp does or should do. And in Emacs it's had if you omit the "and j", (loop for elem in '(1 2 3) for k = elem do (print k)) => 1 2 3 Nosing around the macro expansion I wondered if the "step" of k/j gets mispositioned if there's an `and', but it's hard to be sure. I struck this when making a loop over an alist where I thought to take apart the key and value with an `and' as they didn't need to be sequential, (loop for elem in my-alist for k = (car elem) and v = (cdr elem) do ... Alas the effect of the "1 1 2" was to double the first element and omit the last. In GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-05-16 on raven, modified by Debian configured using `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default enable-multibyte-characters: t