From f49fe936abd48f7458596893d25e3300f59508be Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 20 May 2023 10:50:25 +0200 Subject: [PATCH] * etc/NEWS: Note dotimes loop variable scoping change (bug#63586) --- etc/NEWS | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.39.2