GNU bug report logs - #63588
29.x: dotimes (possible) problem

Previous Next

Package: emacs;

Reported by: balducci <at> dschgrazlin2.units.it

Date: Fri, 19 May 2023 15:22:02 UTC

Severity: normal

Merged with 63586

Fixed in version 29.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#63588: closed (29.x: dotimes (possible) problem)
Date: Wed, 06 Sep 2023 20:11:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 6 Sep 2023 13:10:40 -0700
with message-id <CADwFkmnj5viU_Gf_ZHvTXPSroyTsswoJEygLTpVHYq0Ly6q9XQ <at> mail.gmail.com>
and subject line Re: bug#63588: 29.x: dotimes (possible) problem
has caused the debbugs.gnu.org bug report #63588,
regarding 29.x: dotimes (possible) problem
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
63588: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63588
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: balducci <at> dschgrazlin2.units.it
To: bug-gnu-emacs <at> gnu.org
Subject: 29.x: dotimes (possible) problem
Date: Fri, 19 May 2023 10:54:46 +0200
hello

the dotimes macro behaves differently in 29.x with respect to previous
versions

Basically: changing the value of the loop variable in the body of
dotimes does not seem to have any effect, where for versions <29.x it
used to.

Here is a minimal stretch of dummy code clarifying the problem I'm
reporting.

emacs-29.0.91 (or 29.0.90)
==========================

(dotimes (ii 10)
(insert (format "%2d " ii))
(when (= ii 4)(setq ii 11))
)
==>  0  1  2  3  4  5  6  7  8  9 

emacs-28.2 (or any version <29.x)
=================================

(dotimes (ii 10)
(insert (format "%2d " ii))
(when (= ii 4)(setq ii 11))
)
==>  0  1  2  3  4 

The ability to jump out of the loop by pushing the loop variable over
the upper limit is something that I happen to use in my scripts, so
29.x breaks them somehow

Of course, there are very many other equivalent ways to
accomplish the same result, but I don't see why this one
shouldn't be supported (any longer)

Is the changed behavior intentional? Am I missing some blatant point here?

AFAICS, changing the value of the loop variable from inside the loop
body is supported by any other language which I know about

thank you very much in advance for any hint/feedback

ciao
-gabriele


[Message part 3 (message/rfc822, inline)]
From: Stefan Kangas <stefankangas <at> gmail.com>
To: Mattias EngdegÄrd <mattiase <at> acm.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63588-done <at> debbugs.gnu.org,
 63586 <at> debbugs.gnu.org, balducci <at> units.it,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#63588: 29.x: dotimes (possible) problem
Date: Wed, 6 Sep 2023 13:10:40 -0700
Version: 29.1

Mattias EngdegÄrd <mattiase <at> acm.org> writes:

> 19 maj 2023 kl. 19.47 skrev Eli Zaretskii <eliz <at> gnu.org>:
>
>> Feel free to suggest a NEWS entry, and thanks.
>
> There is now a NEWS entry in emacs-29. Do modify it as you like.

It seems like that was all that needed doing here, so I'm closing this.


This bug report was last modified 1 year and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.