From: Mattias EngdegÄrd Date: Sat, 20 May 2023 08:50:25 +0000 (+0200) Subject: * etc/NEWS: Note dotimes loop variable scoping change (bug#63586) X-Git-Tag: emacs-29.0.92~127 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f49fe936abd48f7458596893d25e3300f59508be;p=emacs.git * etc/NEWS: Note dotimes loop variable scoping change (bug#63586) --- diff --git a/etc/NEWS b/etc/NEWS index fa428d9c790..cdad1796e77 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3871,6 +3871,19 @@ The following generalized variables have been made obsolete: 'standard-case-table', 'syntax-table', 'visited-file-modtime', 'window-height', 'window-width', and 'x-get-secondary-selection'. +--- +** The 'dotimes' loop variable can no longer be manipulated in loop body +Previously, the 'dotimes' loop counter could be modified inside the +loop body, but only in code using dynamic binding. Now the behaviour +is the same as when using lexical binding: changes to the loop +variable has no effect on subsequent iterations. That is, + + (dotimes (i 10) + (print i) + (setq i (+ i 6))) + +now always prints the numbers 0 .. 9. + * Lisp Changes in Emacs 29.1