From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: Sv: Is this a bug in while-let or do I missunderstand it? Date: Sat, 9 Nov 2024 13:47:07 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_DU2PR02MB1010965F97C49223E929DA7E0965E2DU2PR02MB10109eu_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17098"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 09 15:56:18 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t9msr-0004Ih-Td for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Nov 2024 15:56:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9msO-00007Q-Pn; Sat, 09 Nov 2024 09:55:48 -0500 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 1t9lo5-0005Oa-Uz for emacs-devel@gnu.org; Sat, 09 Nov 2024 08:47:20 -0500 Original-Received: from mail-am6eur05olkn2080e.outbound.protection.outlook.com ([2a01:111:f403:2e12::80e] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9lo0-0008Gs-QX for emacs-devel@gnu.org; Sat, 09 Nov 2024 08:47:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FogK/5KgMIdp6Q5ohSUe7SRP2FsvoX3gxolNBipVZ1CPizPhv1enY6PJqgGsg91BxvuvxE1V25/loKsQbwaCFrmqAnpRFHvPjXED44LdfTtnscCmFaivVM8iXVTo8wFQ8DOFDzIJaZNfBix/4yI2xVhTGjIHS28L9l6Y5ikECH80sAvns/ugh/rTXI2EbBaW8U07TcPSKs2fKSp4xdMsBszd0mCKwMTvfdHYLB1idYt3+uWwf/clv6vE+aQ1a7s57CjASvmfeSee5OKpidCkdmteHTBqnAw8OlXsHFfu9qNO4a4tx8eaQsjSSI1s/7GkPrCr6+Jmqe5x99UmvrXvrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kk6jVES/+097SQrr9NNYfmcpkXqktRRRMDMHQpEitYQ=; b=htD7zMN/rkWBfnClHYrqicUJXjpKy7KCVkXnYvav+8Dl7aOeL1ycjscFCeN6zgr/7Dd95/NdFxrj5w+ZhjiPK/VbwrqPOcQno8DQGCJTimESaUFhbVQk/V7e0ORWMcSJk2i+BVtSGUiIEYMVz+K4wj6yuPBV0lU/0X69Ee9TCDB+EFzkDjDJdSDXsGi5NCEpfTLyIEfoRFyOq0vca0YX76DPaKJreH4EqSlv2n6q2Ki/1N1lemJDp6SGXeAqhdsU3WcDuyK/C/bVwt25W7VvSLXD+VXy5dutF0M0K2S22S2fjpt44Qc4CThkdleAUNnvmsDxagpwJbw4YGlZO6PLxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kk6jVES/+097SQrr9NNYfmcpkXqktRRRMDMHQpEitYQ=; b=K8qhn45Dc9CHpjp94uhm4TNLOdDq2BJvgS+3W7mX6DsAzu2uSa8z+k7+QaDIE+e4KpmmoUfbEV28FsdkqWQwUupSWHevhyUkazUYflgMy8xW7uRWgTlFDBGBsT3PzobwgFblEFrhjRq8qjFmI5dPVvp5XZp0IGqPhjU3Sb05SCopHtUeItM3+1y8KAENHebeXOllA0x7wwWO1UIkVoSVbyKXZOYqXyw0AM+u8MU2guZBYpl1ARIkAqJzzuYljHgC2/kvCHQfRb2vrfyTWvqVKu+kCdeNl+jmKX77H3+vd/hRaYcHMpTNMWwxmGx/qSbNl06wN1V2eLuZ7mQ3LOm6aQ== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by VI0PR02MB11018.eurprd02.prod.outlook.com (2603:10a6:800:25e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21; Sat, 9 Nov 2024 13:47:08 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::f3c9:d4cb:290:d487]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::f3c9:d4cb:290:d487%4]) with mapi id 15.20.8137.022; Sat, 9 Nov 2024 13:47:07 +0000 Thread-Topic: Is this a bug in while-let or do I missunderstand it? Thread-Index: AQHbMfbIoZNom93mHkmQsSTvSCnRb7Kur/AAgAA0XUGAAAq2gIAAAU7JgAAF/YCAAAA4ew== In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: sv-SE x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU2PR02MB10109:EE_|VI0PR02MB11018:EE_ x-ms-office365-filtering-correlation-id: a7722a52-706d-4870-d65b-08dd00c50064 x-microsoft-antispam: BCL:0; ARA:14566002|7092599003|15080799006|8060799006|19110799003|15030799003|8062599003|461199028|102099032|3412199025|440099028; x-microsoft-antispam-message-info: =?Windows-1252?Q?08vpdEyVusto0MB7gV5LJ8/OT1Kwg0QjCt0fcRJkaJQSe7ipqQW+uCOZ?= =?Windows-1252?Q?tMn8BTlMMACEjMyufwEqPGU8qyvaDO8vWaQWvAdsRmFRzqCCjRu+zu8z?= =?Windows-1252?Q?IjfW11E6ovm14twtb+V+RUUJKogTKHwOC5PBp426nQ7IgZnH8nWRHcla?= =?Windows-1252?Q?fHuJSszMluVMCLrcSMsOkbV5UWJApGSIxLPDhDH3bWsUMbx9xeurGh8l?= =?Windows-1252?Q?M4kRTp6DFPrPo4HixJgg+wemoJoMUvcNrwDbjTJL6RewJls1eDkGsUNt?= =?Windows-1252?Q?O+x7ZXJ0CqHaGAD6LxpmnV7uLWNs5hHrqiSSP76rZFNMIKUDa6EwuGA1?= =?Windows-1252?Q?JrPWJrjUDvMcYiIb6+g8GZ/DpDWd9qFQtjfY9k3sRKEU9fjB2EfOXYwz?= =?Windows-1252?Q?Wl5g3ZpVNmHyDsj45YCsgImv+YDYO8D4Z9Rjq17NhfFNuieLx1yfNMm4?= =?Windows-1252?Q?SPcK1G4moP2JlRw61o9rAZBcKs8w/UQs+HcmQzqva9HJM2cjqOcJbhFI?= =?Windows-1252?Q?dMLp+Z3WiTwCTKkkDdZSwnatLxUlInQ5KGvjQmMlmBgC/+74Nx81n3F5?= =?Windows-1252?Q?1T8PLcdNJCy/KApsZ1ardWBoXcEDCIv7ezCK2QMWC7ZNOTCFC4B850+w?= =?Windows-1252?Q?y x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?BwgQxh8ohq0+y4NbPahF8/nxhHH7hP2+hBZ0G/BYy2UfBtlaImAexyj1?= =?Windows-1252?Q?94idD+rao2vOv1vFd8NMVimf7VguY/YjA88CQZEZU0QVWCOdspPgdqUD?= =?Windows-1252?Q?wFM6W+vgA1nzmoKh5SV1i8nYUyFFNN1ERbPZmSdrxniq5aIei7n+FIvu?= =?Windows-1252?Q?mkN+uSdcIHngkZf6dEcwsFbMNhxiJI5fR7+rvDcpYB4hlRp8lUooHqt+?= =?Windows-1252?Q?1pCikBjfuEbLOegR/R8uaLKLTeF7XYCacjqd0oE3l5QTpej0WmkZWHmQ?= =?Windows-1252?Q?P/0d+qzV6UQJSi/x/eUfQQgmRIZGHqphZyIchyDPk++T2QRLOT8X9Aw+?= =?Windows-1252?Q?g+I5OLqpUH4CcUEAHtfLHCMqTy6lvjOupgwuEh3dcB67B0QZVUEWUPPm?= =?Windows-1252?Q?k+wsdRNyiSNCTtRMonokCQk8q2mDQzL1t/FTleVSZ3Mtcd4pVx/PoXXI?= =?Windows-1252?Q?+jsaZh7vpbyDUdIuTaiocJWik6/loxdXe3rCbKFxYFJj8PL2u6Twpwan?= =?Windows-1252?Q?xi/QNH/Py6gMVjmDQzRYznw10orE9sBvvaLnmFPK56bn4F6xxwFf6I1o?= =?Windows-1252?Q?2YvL1orPPnNji3ULvYZS+vvKGuFbKiYnFWC0dcOpgIHVsCVIVPIL3mOe?= =?Windows-1252? X-OriginatorOrg: sct-15-20-7828-19-msonline-outlook-12d23.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a7722a52-706d-4870-d65b-08dd00c50064 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2024 13:47:07.1086 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR02MB11018 Received-SPF: pass client-ip=2a01:111:f403:2e12::80e; envelope-from=arthur.miller@live.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 09 Nov 2024 09:55:47 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325335 Archived-At: --_000_DU2PR02MB1010965F97C49223E929DA7E0965E2DU2PR02MB10109eu_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable >> least very unintuitive behaviour. > >Why? Pretty much all implementations of the =91while=92 loop in all >languages I=92ve seen re-evaluate the condition on every iteration. That wasn't the un-intuitive part :-). If it wasn't clear, the unintuitive part is that while-let was to establish the local environment, so that we don't need to type: (let ((som-var (init-form))) (while some-var ... )) At least is how I understand the purpose of if-let, when-let and while-let. ________________________________ Fr=E5n: Yuri Khan Skickat: den 9 november 2024 14:41 Till: arthur miller Kopia: emacs-devel@gnu.org =C4mne: Re: Is this a bug in while-let or do I missunderstand it? On Sat, 9 Nov 2024 at 20:38, arthur miller wrote: > >I expect the binding is writable *but* it gets re-assigned on each itera= tion. > > Yes. > I have already posted the macro expansions in respone to Phillip. > It is quite clear what is going on. I think it is a bug, or at > least very unintuitive behaviour. Why? Pretty much all implementations of the =91while=92 loop in all languages I=92ve seen re-evaluate the condition on every iteration. --_000_DU2PR02MB1010965F97C49223E929DA7E0965E2DU2PR02MB10109eu_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
>> least very unintuitive behaviour.
>
>Why? Pretty much all implementations of the =91while=92 loop in all
>languages I=92ve seen re-evaluate the condition on every iteration.

That wasn't the un-intuitive part :-).

If it wasn't clear, the unintuitive part is that while-let was to
establish the local environment, so that we don't need to type:

(let ((som-var (init-form)))
    (while some-var
        ... ))

At least is how I understand the purpose of if-let, when-let and while-let.=

Fr=E5n: Yuri Khan <yuri.= v.khan@gmail.com>
Skickat: den 9 november 2024 14:41
Till: arthur miller <arthur.miller@live.com>
Kopia: emacs-devel@gnu.org <emacs-devel@gnu.org>
=C4mne: Re: Is this a bug in while-let or do I missunderstand it?
 
On Sat, 9 Nov 2024 at 20:38, arthur miller <art= hur.miller@live.com> wrote:

> >I expect the binding is writable *but* it gets re-assigned on each= iteration.
>
> Yes.
> I have already posted the macro expansions in respone to Phillip.
> It is quite clear what is going on. I think it is a bug, or at
> least very unintuitive behaviour.

Why? Pretty much all implementations of the =91while=92 loop in all
languages I=92ve seen re-evaluate the condition on every iteration.
--_000_DU2PR02MB1010965F97C49223E929DA7E0965E2DU2PR02MB10109eu_--