From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: Re: Sv: Better documentation for non-binding clauses of if-let and friends Date: Mon, 11 Nov 2024 12:18:58 +0100 Message-ID: <86a5e681ct.fsf@fastmail.fm> References: <86msi69icp.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23886"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Alfred M. Szmidt" , "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 12:20:28 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 1tAST5-00060O-38 for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Nov 2024 12:20:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tASRv-0007IX-Qp; Mon, 11 Nov 2024 06:19:16 -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 1tASRo-0007IA-2D for emacs-devel@gnu.org; Mon, 11 Nov 2024 06:19:09 -0500 Original-Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tASRl-0002er-Bw; Mon, 11 Nov 2024 06:19:07 -0500 Original-Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 27F591140158; Mon, 11 Nov 2024 06:19:03 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Mon, 11 Nov 2024 06:19:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1731323943; x=1731410343; bh=nM+znEMCkN OJJP7mh86iB2nGTQvMYmvE84yIZuO+KUQ=; b=TAGrxzB1dNSrr/fjBuAmTan6aj z2d/kL8MxlClxx4zWTupWLvrS/ofu9pElRsjDatyZ2+V4b+7zLmcO9/x/R47CTuy Sgw3A0+LHaifs1HSCtUDhNuUNskSZ/ZZwXeBXAWnA3+1eKe6rJWGiNTKloZhTLWc 3/btb7nIdMMsh56fGXIj19h9Tqep60GoYiD8p2Yc8eLpNMTR8F1ApvKVERj9On6O p04T+X5BgyW5mi1lf0J28ZwC0ImTJxy4UxRfsA6b7i3BrWRpdXak60U/BoYiv2Mb O/Pld0krRlKxkijAhtLJnrYi/Tb4Pw4is7bjOECeHgi+jvoHhe5kEe5B/gvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1731323943; x=1731410343; bh=nM+znEMCkNOJJP7mh86iB2nGTQvMYmvE84y IZuO+KUQ=; b=PwL9mtPXp5BXsnUN/EXSkYkBOE6JFMEJ/qFflGLz+sgO/1pKB/T 5ABZFA8tQFXNg3lk9P2ScnqEwcthqz3dm1OvuCkRpneIi7opRZnV/PnLPle5dH4w PT9AHIEE1Z0byOOocqpyF7YfU2c2XBXBQscsVNX3PWewuxu8d/XmzyK43IEuqzvg rh482NfblgcnzEsljsxRJeC8JYISkooCRFWog7mGBWsW1iBNVVo31jozTUcp29Uj ezZhq+f/WWcRv6WFGlu+C5hTTwsBbtZXuXjY21U4gip9T3P6bsQDq1d7DWTHIRft 2O7RCzby6D/LkBl4hT+yC1zTE5zs/wtzF4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddvgddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfggtgesthdtredttddttdenucfh rhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrsh htmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepkeevleeiueeltedtfeeugedvudek hfegveeludevieelteekgefgkefhueffffeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghi lhdrfhhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtth hopegvmhgrtghsqdguvghvvghlsehgnhhurdhorhhgpdhrtghpthhtoheprghmshesghhn uhdrohhrghdprhgtphhtthhopegrrhhthhhurhdrmhhilhhlvghrsehlihhvvgdrtghomh X-ME-Proxy: Feedback-ID: ie15541ac:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 06:19:01 -0500 (EST) In-Reply-To: (arthur miller's message of "Mon, 11 Nov 2024 10:53:04 +0000") Received-SPF: pass client-ip=103.168.172.155; envelope-from=joostkremers@fastmail.fm; helo=fhigh-a4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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:325400 Archived-At: On Mon, Nov 11 2024, arthur miller wrote: > Problem is when one introduce repetition: while-let re-establishes the bindings a new > for each repetition, which is a bit unusual I believe. I agree it's not immediately obvious, especially if you're trying to grok `while-let` on the basis of `while`, so it should definitely be pointed out in the documentation in the manual and the doc string, which currently isn't the case. It might be more obvious if you take `let` as your starting point for grokking `while-let`, but then the non-binding forms can be confusing. So that should be mentioned more explicitly as well, I think. I do think reestablishing the bindings on each iteration makes sense, given the purpose of `while-let`. I don't think it would be a very useful macro if it were otherwise. But I have to admit I haven't yet had any occasion to use `while-let`, and I haven't studied it in the wild, so I can't be entirely sure. (Though I imagine that inside the loop, you would want to use the *current* value of each of the conditions, not the value established on the first iteration.) -- Joost Kremers Life has its moments