From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#29799: 24.5; cl-loop guard clause missing Date: Fri, 22 Nov 2019 15:53:10 +0100 Message-ID: <87d0dkq7xl.fsf@gnus.org> References: <87d138beur.fsf@gmail.com> <87pnhkke27.fsf@dick> <87h82wrry9.fsf@gnus.org> <87mucorpd0.fsf@dick> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="35998"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 29799@debbugs.gnu.org, npostavs@gmail.com, monnier@iro.umontreal.ca, Tino Calancha To: dick.r.chiang@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 22 15:54:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iYAK4-0009Dt-PN for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Nov 2019 15:54:12 +0100 Original-Received: from localhost ([::1]:51870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYAK3-0000l8-1y for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Nov 2019 09:54:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37796) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYAJv-0000ht-QX for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 09:54:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iYAJu-00027f-L9 for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 09:54:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45226) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iYAJu-00027Z-Hc for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 09:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iYAJt-0001AD-Kq for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 09:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Nov 2019 14:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29799 X-GNU-PR-Package: emacs Original-Received: via spool by 29799-submit@debbugs.gnu.org id=B29799.15744344064428 (code B ref 29799); Fri, 22 Nov 2019 14:54:01 +0000 Original-Received: (at 29799) by debbugs.gnu.org; 22 Nov 2019 14:53:26 +0000 Original-Received: from localhost ([127.0.0.1]:54047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYAJI-00019L-MG for submit@debbugs.gnu.org; Fri, 22 Nov 2019 09:53:25 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:50410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iYAJG-000196-Bb for 29799@debbugs.gnu.org; Fri, 22 Nov 2019 09:53:23 -0500 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iYAJ5-00043n-O9; Fri, 22 Nov 2019 15:53:14 +0100 In-Reply-To: <87mucorpd0.fsf@dick> (dick r. chiang's message of "Fri, 22 Nov 2019 08:51:23 -0500") 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: 209.51.188.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:172241 Archived-At: dick.r.chiang@gmail.com writes: >>> ;; should return (1 0) (cl-loop with result for x below 3 for y below 2 and >>> z = (progn (push x result) nil) finally return result) > >> I applied the patch and ran that test case, and it returned >> (2 1 0). But shouldn't it return (2 1)? > > Ah, clisp also returns (2 1 0), so while my initial claim is wrong, I am happy > the patch conforms with clisp. > > My human instinct is to say it should return (1 0), but the simultaneity > semantics of "and" are tricky. > > Under no interpretation, do I see it returning (2 1). > > iter#1 x is 0, *simultaneously* set y = 0 and result = (0) > iter#2 x is 1, *simultaneously* set y = 1 and result = (1 0) > iter#3 x is 2, *simultaneously* break out of loop and result = (2 1 0) Yes, you're right -- I was somehow thinking that "below 3" meant the same as "from 2 downto 0" instead of what it really means: "upto 2". And that "for ... and" meant that I had never realised. :-) loop is a complicated language. So it all looks correct to me now, and I'm applying your patch. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no