unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: npostavs@users.sourceforge.net
Cc: 6583@debbugs.gnu.org
Subject: bug#6583: 23.2; cl loop macro with `and' clause
Date: Sat, 24 Jun 2017 21:03:28 -0600	[thread overview]
Message-ID: <87a84wu5tr.fsf@lylat> (raw)
In-Reply-To: <87injkq5la.fsf@users.sourceforge.net> (npostavs's message of "Sat, 24 Jun 2017 20:22:09 -0400")

npostavs@users.sourceforge.net writes:

> Alex <agrambot@gmail.com> writes:

> I can't claim to fully understand the loop macro implementation, but
> your patch breaks this example from the manual `(cl) For Clauses':
>
>      (cl-loop for x below 5 for y = nil then x collect (list x y))
>              => ((0 nil) (1 1) (2 2) (3 3) (4 4))
>      (cl-loop for x below 5 and y = nil then x collect (list x y))
>              => ((0 nil) (1 0) (2 1) (3 2) (4 3))
>
> With your patch the second loop gives ((0 nil) (1 1) (2 2) (3 3) (4 4))
> like the first.

You're right, sorry. This breaks loops with variables that are updated
in loop-for-steps rather than loop-for-sets. When I started testing
other cases I was accidentally using the pre-patch branch to do so.

I can't think of an easy solution to cover both problems right now. If
no one better suited can figure this out, I'll come back to this after
completing an ert suite for cl-loop (of which I'm part-way through).





  reply	other threads:[~2017-06-25  3:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 23:33 bug#6583: 23.2; cl loop macro with `and' clause Kevin Ryde
2010-07-08  7:40 ` Thierry Volpiatto
2010-07-08  8:28 ` Lawrence Mitchell
2016-06-02 22:06 ` Noam Postavsky
2017-06-10 19:10 ` Alex
2017-06-25  0:22   ` npostavs
2017-06-25  3:03     ` Alex [this message]
2020-09-14 13:10       ` Lars Ingebrigtsen

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=87a84wu5tr.fsf@lylat \
    --to=agrambot@gmail.com \
    --cc=6583@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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).