From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Is this a bug in while-let or do I missunderstand it? Date: Mon, 11 Nov 2024 12:13:45 +0700 Message-ID: References: <86ldxrliau.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40279"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , "ams@gnu.org" , "emacs-devel@gnu.org" To: arthur miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 11 06:14:50 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 1tAMlG-000AMB-55 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Nov 2024 06:14:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAMkx-0007eY-Mk; Mon, 11 Nov 2024 00:14:34 -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 1tAMkW-0007PG-0d for emacs-devel@gnu.org; Mon, 11 Nov 2024 00:14:06 -0500 Original-Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAMkR-0008UA-9u; Mon, 11 Nov 2024 00:14:01 -0500 Original-Received: by mail-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-5139cd002b7so1612724e0c.0; Sun, 10 Nov 2024 21:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731302037; x=1731906837; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r9L5PdMyKxuhfyf2027oXX6tdBHT1bGqCZQGLZg1cF8=; b=DTOkrljN2m0OK1KWcgFCrxI3BdNdaXmra/bpTAm2mlkFqDq3vqhaMnJNEB9OahBj4H M+HGBT0WMcT1qSKfqMoJqJAKPJm6ijis5W5MfpncX1QVGtxClRBmoT+wk5c8gFNet/iz 60eACYEIiOvM0nj2ZgofSenWN6PfyeALrt0cZQqDKMr7vGUMWfq8D+hSpFGTJDtZ9FOn 6LeGCYLru864mzRua/S6gKckeGoefF2UPO668VZozn4tGrEtBM33TuoRRSzMCZYOgybo oJzzjthOcVs5WLg0VO/vDj6DtbubsD20hIHlGWRJTr2fC5mXKwuDRgZYWPUB3h5mko7H 9plg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731302037; x=1731906837; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r9L5PdMyKxuhfyf2027oXX6tdBHT1bGqCZQGLZg1cF8=; b=m4sSWDR3eCCY2jFyWZkIh34DUB/ePwHsBer9MQ6ZH9czpKqGHQPE9TQa1/p5KVh4hx dreqSYe+Ms/ok4Xtd87jzgdBAKmPveyk2IenAJ+zjDVSciJ88Znz8l2YPtV2ouxXC7w/ 4QhgVdAouTO4jrVNFvEjDfPs1ng8r2lruwD3Ks8+yN/UHxM0n9v183Ww2F03qH3M/T0g YyUq2gW5D1XELuts2YexExULqOjJ7ur4tXGvGiu639py7pS10/buB20gkTKIecZOHcdy A4OokQkwWqFApP39mVvsKBGNlUsYRcNTHqYTrRHwZTbQAvjwyLf3SHAGXaD+Q6ielJKx LcaQ== X-Forwarded-Encrypted: i=1; AJvYcCVAe9sT3vpPbV2CA0yjkzflnL1lSaqbILW5Hh1+lALu05eshwt/NNe55QRxmFfDD1kBOO4=@gnu.org, AJvYcCXDL0pCMaVTE7oWtUabejcreK8ThRczOB5XzDx4+8hvliikJLQRsPYrBGRqeQpTW1mSmlm9jeGoD45vRfo=@gnu.org X-Gm-Message-State: AOJu0YxRPmMyeAMcwy0618IVDYnAXGjhdcmbZmT7jhlyzZ1MaxoEoCoM iEgXI3PN113A63/3ZWppOCaRdmaaVADm3dJrNMmcnvubzSbnBAfZHlT3MJruo2vfolC3pIZpQSz Tsuy0Q/RPJunFDRJA16xiC905XH6T9baV/KY= X-Google-Smtp-Source: AGHT+IFhIebCp56nxZ++dtDCXy65N9YY3gUWbJc2p891esL5gL43RwMcmvvDndqriw9Cr+ETNC8mIwuHN8z8IxClwoM= X-Received: by 2002:a05:6102:953:b0:4a5:e5e5:f929 with SMTP id ada2fe7eead31-4aae13b1d14mr10092278137.13.1731302036652; Sun, 10 Nov 2024 21:13:56 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::a2b; envelope-from=yurivkhan@gmail.com; helo=mail-vk1-xa2b.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:325394 Archived-At: On Mon, 11 Nov 2024 at 01:18, arthur miller wrote: > As I understand it now, Emacs while-loop is a unique kind of loop, at lea= st > I have never seen a construction with such semantic before. The semantic > of while-let in Emacs is that of for-loop or while-loop in C++, but where > initialization of loop variables happens on each iteration > > for (int i=3D0; i we can read i here, but > we can't write to it > } Comprarison with a for loop is somewhat strained here. The while-let loop in Elisp is directly analogous to this C++ while loop: #include int main() { while (bool run =3D true) { std::cout << "running\n"; run =3D false; } std::cout << "out of loop\n"; } and yes, it=E2=80=99s an infloop, too. What you=E2=80=99re looking for, though, seems to be a while loop with a break, which is expressed as a catch/throw in Elisp.