all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63588: 29.x: dotimes (possible) problem
@ 2023-05-19  8:54 balducci
  2023-05-19 15:42 ` Drew Adams
  2023-05-19 16:07 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: balducci @ 2023-05-19  8:54 UTC (permalink / raw)
  To: 63588

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





^ permalink raw reply	[flat|nested] 4+ messages in thread
* bug#63586: 29.x: dotimes (possible) problem
@ 2023-05-19 15:10 balducci
  2023-05-19 16:00 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: balducci @ 2023-05-19 15:10 UTC (permalink / raw)
  To: 63586

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-06 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-19  8:54 bug#63588: 29.x: dotimes (possible) problem balducci
2023-05-19 15:42 ` Drew Adams
2023-05-19 16:07 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2023-05-19 15:10 bug#63586: " balducci
2023-05-19 16:00 ` Eli Zaretskii
2023-05-19 17:29   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-19 17:47     ` Eli Zaretskii
2023-05-20  8:56       ` Mattias Engdegård
2023-09-06 20:10         ` bug#63588: " Stefan Kangas

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.