unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: dick.r.chiang@gmail.com
Cc: 29799@debbugs.gnu.org, npostavs@gmail.com,
	monnier@iro.umontreal.ca, Tino Calancha <tino.calancha@gmail.com>
Subject: bug#29799: 24.5; cl-loop guard clause missing
Date: Fri, 22 Nov 2019 15:53:10 +0100	[thread overview]
Message-ID: <87d0dkq7xl.fsf@gnus.org> (raw)
In-Reply-To: <87mucorpd0.fsf@dick> (dick r. chiang's message of "Fri, 22 Nov 2019 08:51:23 -0500")

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





      reply	other threads:[~2019-11-22 14:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21  9:38 bug#29799: 24.5; cl-loop guard clause missing Tino Calancha
2018-01-01 21:46 ` Noam Postavsky
2018-01-01 22:58   ` Noam Postavsky
2018-01-03 10:34     ` Tino Calancha
2018-01-06 13:43       ` Noam Postavsky
2018-01-08 10:20         ` Tino Calancha
2019-10-28  3:59 ` dick.r.chiang
2019-11-21 23:25 ` dick.r.chiang
2019-11-22 12:55   ` Lars Ingebrigtsen
2019-11-22 13:51     ` dick.r.chiang
2019-11-22 14:53       ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0dkq7xl.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=29799@debbugs.gnu.org \
    --cc=dick.r.chiang@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@gmail.com \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).