From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63586: 29.x: dotimes (possible) problem Date: Fri, 19 May 2023 19:00:13 +0300 Message-ID: <83ednctipe.fsf@gnu.org> References: <4450.1684509068@dschgrazlin2.units.it> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21803"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63586@debbugs.gnu.org To: balducci@units.it, Stefan Monnier , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 19 18:01:42 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q02Y2-0005VI-Su for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 May 2023 18:01:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q02XW-0005Cp-Qt; Fri, 19 May 2023 12:01:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q02XP-0005AA-RR for bug-gnu-emacs@gnu.org; Fri, 19 May 2023 12:01:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q02XP-00047j-1v for bug-gnu-emacs@gnu.org; Fri, 19 May 2023 12:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q02XO-000259-1o for bug-gnu-emacs@gnu.org; Fri, 19 May 2023 12:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 May 2023 16:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63586 X-GNU-PR-Package: emacs Original-Received: via spool by 63586-submit@debbugs.gnu.org id=B63586.16845120087928 (code B ref 63586); Fri, 19 May 2023 16:01:02 +0000 Original-Received: (at 63586) by debbugs.gnu.org; 19 May 2023 16:00:08 +0000 Original-Received: from localhost ([127.0.0.1]:57214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q02WW-00023o-AQ for submit@debbugs.gnu.org; Fri, 19 May 2023 12:00:08 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q02WU-00021d-2T for 63586@debbugs.gnu.org; Fri, 19 May 2023 12:00:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q02WN-0003XA-HB; Fri, 19 May 2023 11:59:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=09iWKHt8xgHcKIcB8ue9HPtGu+WsSQZJGd16Hmngwe0=; b=Z3O9BMhkiSTM3B3X8gcb emrwDpu8nQMJS+oZRVN3Mxl93lszGdt3Ul4+JXa2KCiB5+E7jvoyPeP6HlrFH4KNi/kdJN08qUQBI r16F/U9wCN20hdRU87sfv5mMOWq9GwY/O7PhbNHRXZogN8XVQ6WNKBNHkn/fboD/xZOpto2x1Jl9c qywSfbUYM089L621Zcq1F4kJKGV7syUWeO9a0cMFaIZh1l394nBXnfsnu72CdLDu5g0lkl5oKuxvZ qypIEeGIAxF5Zh1VlVsF74pfX0n9rW2AyEl7ej+1srvaJdK91pNw0idNC7CI/8+swi30GuQT5TL3E zoo25QnBxkTEtQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q02WM-0003bi-Hg; Fri, 19 May 2023 11:59:59 -0400 In-Reply-To: <4450.1684509068@dschgrazlin2.units.it> (balducci@units.it) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262012 Archived-At: > From: balducci@units.it > Date: Fri, 19 May 2023 17:10:44 +0200 > > 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 I can only reproduce the behavior you see in 28.2 in Emacs 26.3. All the later versions, starting from 27.1, behave like Emacs 29 does. > 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 Adding Stefan and Mattias who made changes in dotimes recently.