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: Is this a bug in while-let or do I missunderstand it? Date: Sat, 09 Nov 2024 22:47:55 +0100 Message-ID: <86r07kaxkk.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36855"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuri Khan , "emacs-devel@gnu.org" To: arthur miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 09 22:48:43 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 1t9tJy-0009Ry-1m for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Nov 2024 22:48:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9tJL-0003Qe-CR; Sat, 09 Nov 2024 16:48:03 -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 1t9tJK-0003QR-8i for emacs-devel@gnu.org; Sat, 09 Nov 2024 16:48:02 -0500 Original-Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9tJI-0004eR-Ai for emacs-devel@gnu.org; Sat, 09 Nov 2024 16:48:02 -0500 Original-Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0609025400A4; Sat, 9 Nov 2024 16:47:58 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sat, 09 Nov 2024 16:47:59 -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=1731188878; x=1731275278; bh=uWAnd9LhWY inZluJGz4mPTu7T3vyxyjLS/WkXeanVkA=; b=bo/NXfhgh3HKu5qyHHtsrObmrZ 4ZzszG1NCqDqWPvl1p3G/P0JM0BKZuhANucYPZUZVtPqX1AKoZp3gf5ZveH00gdr dW8n75ESTlX8yf79xREbpzib6zkJuhunN48XaVL/+Ao9oivsqI+HonVQs1vu4ru7 TJRopyrsvu0bn8LHZxO5pxLzekRi2t59P/DjRV9MsNRdQ9J5CwcKGaDV0P+B6z/P cxeHsXKjMsEnfbLNgbukSIwZx86PitH8yMN4VPoznRHETQvyCZKBOSfZN9M7quOE L7hCVTPhs5R54CNsWLzOCzYDujnpPHH3QqyusADwbyTRrvv5VwYsCGMFsP7w== 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= 1731188878; x=1731275278; bh=uWAnd9LhWYinZluJGz4mPTu7T3vyxyjLS/W kXeanVkA=; b=nXRuoLfSlM68YV1YJi8TFR27Ui3g/Ff7a5cvS0qzZEWwr22pY83 k/HUqAQh9PN3IArZaPETHQMRkcbmumdog8kNU8VkagMQ7WQ4lyy47cT7Xnsc2iD+ s7z6O3/iBVJKSDHPb2A0wowXPMLpJsY32PvO3aex3uHLO+YQEJoLjfCXchehIBcP ihFSryvZKgTElK7F53XC9EJ1wNqYAhyCP9sWHw+mWx0WIlevmmqlVzpGwoP2jbKV CY9APC9+A8N4hoXsAF1PuFdN8HuyZR3idrXs0jMjjXFLPYT3lX6xPLsgy8iaRrPW q76G2R8RjT8m9fc/5LmFezdP7fURXsr2PTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrtdekgdduheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecu hfhrohhmpeflohhoshhtucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrg hsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeekveelieeuleettdefueegvddu kefhgeevleduveeileetkeeggfekhfeuffffieenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgr ihhlrdhfmhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrghdprhgtphhtthhopeihuhhrihdr vhdrkhhhrghnsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghrthhhuhhrrdhmihhllh gvrheslhhivhgvrdgtohhm X-ME-Proxy: Feedback-ID: ie15541ac:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 9 Nov 2024 16:47:57 -0500 (EST) In-Reply-To: (arthur miller's message of "Sat, 9 Nov 2024 13:47:07 +0000") Received-SPF: pass client-ip=202.12.124.159; envelope-from=joostkremers@fastmail.fm; helo=fhigh-b8-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:325351 Archived-At: On Sat, Nov 09 2024, arthur miller wrote: > 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. Yes, but for `while`, the pattern isn't complete. The `setq` inside the loop is a crucial part: ``` (let ((a (foo ...))) (while a (do-stuff-with a) (setq a (foo ...)))) ``` So the idea is that you want to test the result of some expression on each iteration. `while-let` basically lets you type that expression only once, instead of twice. At least that's how I understand `while-let`. -- Joost Kremers Life has its moments