Subject: Re: bug#72753: Different output between SBCL `loop` and Emacs `cl-loop`

From: Stephen Berman <[email-masked]>
Date: Thu, 22 Aug 2024 09:57:08 +0200

On Thu, 22 Aug 2024 01:55:07 +0000 Okamsn via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]> wrote:

> Hello,
>
> The following in SBCL 2.1.11 produces 3, which I expected.
>
>      (loop for i in '(1 2 3)
>            for j from 1
>            finally (return j))

I get the same result with SBCL 2.4.5.

> The following in Emacs 29 produces 4, which I did not expect.
>
>      (cl-loop for i in '(1 2 3)
>               for j from 1
>               finally (cl-return j))

I also get 4 with Emacs built from master.

> This is a simplified example that only shows the difference.
>
> I don't know what the standard behavior is, but I personally believe
> that the SBCL output makes more sense.

FWIW, GNU CLISP 2.49.93+ (built from the git repo) returns 4, not 3, for
the above Common Lisp loop sexp.

Steve Berman