emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 f49fe936abd: * etc/NEWS: Note dotimes loop variable scoping cha


From: Mattias Engdegård
Subject: emacs-29 f49fe936abd: * etc/NEWS: Note dotimes loop variable scoping change (bug#63586)
Date: Sat, 20 May 2023 04:53:27 -0400 (EDT)

branch: emacs-29
commit f49fe936abd48f7458596893d25e3300f59508be
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    * 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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]