From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Code for cond* Date: Fri, 19 Jan 2024 10:42:34 +0000 Message-ID: References: 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="23581"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Richard Stallman , emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 19 11:43:29 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 1rQmLQ-0005z1-TM for ged-emacs-devel@m.gmane-mx.org; Fri, 19 Jan 2024 11:43:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQmKq-00059d-Ql; Fri, 19 Jan 2024 05:42:52 -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 1rQmKp-00059L-DT for emacs-devel@gnu.org; Fri, 19 Jan 2024 05:42:51 -0500 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQmKn-0002fw-BZ; Fri, 19 Jan 2024 05:42:50 -0500 Original-Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50f1c524010so196158e87.3; Fri, 19 Jan 2024 02:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705660966; x=1706265766; 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=vk0zcHPnYUcizR362kGCxgNtQYgsw8QdqyDl4FSEcMc=; b=GhzW2ZhFuO8u8O/HjZ/kFWQAzdTHyj1tljrZPDQyizbifclJOBOX/Zf0kkaqS2ZOTb z0/LqSqhu9LO5+ArMVjEsTIJTNlU3BOq1Nli8OGy1R6VbuV9PGmJLnBvei4yFdoG8ecz 7dGRk2ooK6BLSPeFp6DJbKXza6fPMZzSm7WZSbWgAxGvtjcjuW8npiHVVmEUnRJN8WUv oRwD4deQ8LmfDcQZc2+gsg+5mmfvfK/+4M23+Dimuk0dQVzyNWvF0BLIQh0ud2udKKNw oLKuger33EreO30yuuD7gWJYzHVERBCZKOSMLU4LDBGw6hmq/ZWiVG8i3yE7y8QCjigc M8ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705660966; x=1706265766; 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=vk0zcHPnYUcizR362kGCxgNtQYgsw8QdqyDl4FSEcMc=; b=HAIRxmcgTxoHIiM6fqIxkEHZgL9MnZSRO/Jr0xk58c7H5c6CJ3itrDEpW+KWtgiNts F7piT2gI1BzrIfk4KdOTcLK7SljHtg72JXi59ZFubxLXv+yM/vZMNZznkO7qyvWM4EsE sJCLm3XcAQZNQlS5g/PM+faJkZ1nS8RrNUINgVcNuI8LdfTFLJTurBpHvn729TEFGypa 0NQEyRWNOgR9flP9itZaMn3JlpwyPeIEhrM9MMjIjgbxJPuQZMEemmHo0GVVW0POzSrp 1/CgjW47x90KvV+j7KI7XBA/R5seL0INqS02JJ3K9zT+1950wBn53e72LLdbN0gkcMh0 l5ng== X-Gm-Message-State: AOJu0Yyy9d4NayzbxmfAL/tZOkJKvzi7gv9ivcNRR5CZeNL60QqJ/irk c8MTpEU+6a4Wd0kO/mEkiGbMQ38LdZAe/CfCKbljTTcnbVwEb34wcxMupJdq2Mf6RvrC0FrEqJE bamOZPQDRwFcRn+c5H4EBNvYuwwYTYhixRVM= X-Google-Smtp-Source: AGHT+IH1/r9BmQOPeOqDM73ZtJ0y/eVeCAS8K8R3aL4Ey7Vtqnh/jLZcd76h2Zh62eKXoML2jGOj7zxk2aiCERcDHIA= X-Received: by 2002:a19:8c16:0:b0:50e:7b9c:3ed5 with SMTP id o22-20020a198c16000000b0050e7b9c3ed5mr299214lfd.50.1705660965748; Fri, 19 Jan 2024 02:42:45 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x12e.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, T_SCC_BODY_TEXT_LINE=-0.01 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:315109 Archived-At: On Thu, Jan 18, 2024 at 3:44=E2=80=AFPM Andrea Corallo w= rote: > apologies if it was discussed already, wanted to ask: what is the reason > for some of these cond* clauses to keep the binding in effect outside > the clause itself and for the whole cond* construct? At first glance it > doesn't look very idiomatic in Lisp terms to me. I think I asked the same, and Drew Adams and Adam Porter also raised this point: https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00554.html https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00618.html and I'm not sure we eventually clarified it. Apologies if I missed some email addressing it as I'm not following this discussion in detail. Also, since cond* does a strict subset of what pcase does, has any thought been given to implementing 'cond*' _on top_ of 'pcase', like some systems define 'cond' in terms of 'if' (or vice versa)? Not meant as gratuitous provocation, really. I think it'd have advantages: * presumably every cond* feature can be supported (if indeed I'm right about the "strict subset") * it would probably save a lot of repeated code * it would make it easy for those who can already read pcase to just macroexpand the cond* form and see what it is actually doing underneath. So could actually facilitate the adoption path for 'cond*' (as questionable as that path may still be, at least for some parties). Jo=C3=A3o