From: Stefan Kangas <stefankangas@gmail.com>
To: Bohong Huang <bohonghuang@qq.com>
Cc: 73874@debbugs.gnu.org
Subject: bug#73874: 29.4; Inconsistent cl-loop behavior with Common Lisp
Date: Sat, 2 Nov 2024 23:06:29 -0700 [thread overview]
Message-ID: <CADwFkmk4TwySGtQEH_USfjkKiVqEG6ZpaU1+22wcu=TQRt6zKw@mail.gmail.com> (raw)
In-Reply-To: <tencent_A36FC308F4A892916A4DEA5400B583870108@qq.com> (Bohong Huang's message of "Sat, 19 Oct 2024 13:11:11 +0800")
Bohong Huang <bohonghuang@qq.com> writes:
> Hello, Emacs developers! When I was porting a Common Lisp library to
> Emacs Lisp, I found that the following minimal code example fails the
> assertion in Emacs Lisp:
>
> ```lisp
> (cl-loop for i in '(1 2 3)
> for j = (1- i)
> and k = (1+ i)
> do (cl-assert (= i (1+ j) (1- k))))
> ```
>
> But it works fine in any proper Common Lisp implementation:
>
> ```lisp
> (loop for i in '(1 2 3)
> for j = (1- i)
> and k = (1+ i)
> do (assert (= i (1+ j) (1- k))))
> ```
>
> By observing the macro expansion, it seems that `cl-loop` does not
> correctly handle the `for ... and ...` clauses, which should bind
> multiple variables in the current loop context in parallel, but
> `cl-loop` always uses the values from the first iteration.
>
> Thank you in advance for your time on this issue.
Is this a duplicate of Bug#72753?
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72753
prev parent reply other threads:[~2024-11-03 6:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 5:11 bug#73874: 29.4; Inconsistent cl-loop behavior with Common Lisp Bohong Huang via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-03 6:06 ` Stefan Kangas [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADwFkmk4TwySGtQEH_USfjkKiVqEG6ZpaU1+22wcu=TQRt6zKw@mail.gmail.com' \
--to=stefankangas@gmail.com \
--cc=73874@debbugs.gnu.org \
--cc=bohonghuang@qq.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.