From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trevor Arjeski Newsgroups: gmane.emacs.devel Subject: Re: cond* Examples Date: Thu, 09 Jan 2025 16:35:46 +0300 Message-ID: <87r05c6rf1.fsf@gmail.com> 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="36404"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Psionic K , emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 09 15:14:50 2025 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 1tVtJC-0009Ny-NF for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Jan 2025 15: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 1tVtIJ-00006c-O0; Thu, 09 Jan 2025 09:13:56 -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 1tVshV-00082G-Vg for emacs-devel@gnu.org; Thu, 09 Jan 2025 08:35:54 -0500 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVshT-0001t3-SH; Thu, 09 Jan 2025 08:35:53 -0500 Original-Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3863494591bso516315f8f.1; Thu, 09 Jan 2025 05:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736429749; x=1737034549; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v+XhmhQwnuj0tGD8H4sXQ1h1RzeVj/wSKR/nEuGLO9k=; b=Sk1HyCw20vRtQpOFvfJSkrtNagIIVj/09sed6pQwyxAtZRo6p2rfh+WnZ1tEJyVYh0 Y9b85Hno+XvUzxVDRB96DXDPZFHTsOEctKz3j15cZh7Wuawd+0djUzQZU+4KXdQ1fx7V bevfYvxzHOyB2wRZlhAFBmMLs3dOaUvehWicFqSQoMgHf8OIYC4clVH/5Wtvaq4X44Py hJaKOVrn5lBXt6piihnXbSpLjfBsTAbovsJgiKc3VCPR9oW6IfKjVqEd8U/AHte2EBs6 G8mYLTA3inJGUIca10dmYgmGeb6MlOPM2dOUpqfYC4S93OwrKHHAvSeivricVnkNOikm ZZJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736429749; x=1737034549; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=v+XhmhQwnuj0tGD8H4sXQ1h1RzeVj/wSKR/nEuGLO9k=; b=eF2JZBMmeRX3XlL0IlWccpgm+e6waf/jKemKefnNeYMdBo4BGsUKAQjAYHYpH+8+vs vRKxNEH3QYkKEHSNb6ca5ewJujqs00bH/v0/sZBPlDEtjND0iqH7s/uF0jMW978pzC/a 50Ft6lo/kTkcaYBl8Etm4m53Hs6ibCPvDk/z9LZ0M392hihRNzg7Oy3/X6IZkrcfajge HLxWrCsfLbdO6E41CkYawBYPennaJg9SozPG9nr8VLDFUAHo+cyuv3+oYnyMxzGa75sx ZNLoy2lgLW1K3XXbKJ0Pwa8jd2rKHH3htPfsaaORWH85oUaH1webRMjPDLUti+QLSGbs E+0w== X-Forwarded-Encrypted: i=1; AJvYcCV7DfyYiQcvQoV4mJ7rmy1rLHNYtoBS5FpbMI+Y+nO/PeKVXOrRqcE2HeZxzHYVu6IweCcVVWqbeP3S7g==@gnu.org X-Gm-Message-State: AOJu0YyPOHH6BWIHtBGcoK68wB3BVo4iSVtlsAZ5WuwJmk/jz/zRZt1e wyaCk42Vz2HgFtFJYvZaADGVaK45Rm9/pX8UJNdYOoHtDWmGFWzb7UmMnw== X-Gm-Gg: ASbGncsQY1AUcCDvqCkZMw0JmEpsGZfFchHMsJ7aGQ8pdYknnc1hma8A66auq494PJb r+7vvt8cuRyBGVHDR3R0N/Um/a/+KOoxFdVzJOUwiHIvTPSMX6yCTcSRmxZcDKwx6U8cZumRswj kKtnZVURcD3MiKDn7PJGjJydzLqIlGkyAl6cRy8bP7G4JlFogmrpVqdQE6pn4lOxjba/YPFwFAe lNGssiL/OI5w2oOmQrItvFvpSTAwE6qvxZy2MLHlKvJzH7CA1ZgI+w= X-Google-Smtp-Source: AGHT+IGUY+GMPOHMw725R+6xT9ZVvRXBXKoycg3lhOsLETXwFx77sF7zD/lVV5qMOVuqtmTEK2xQ5A== X-Received: by 2002:a5d:64a3:0:b0:388:da2a:e48 with SMTP id ffacd0b85a97d-38a872e1554mr6276344f8f.23.1736429748784; Thu, 09 Jan 2025 05:35:48 -0800 (PST) Original-Received: from trevarch ([2a00:1370:817a:57c:3ad5:47ff:fe7e:7eb3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e3838a3sm1874560f8f.33.2025.01.09.05.35.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 05:35:48 -0800 (PST) In-Reply-To: (Richard Stallman's message of "Wed, 08 Jan 2025 22:51:19 -0500") Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=tmarjeski@gmail.com; helo=mail-wr1-x432.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-Mailman-Approved-At: Thu, 09 Jan 2025 09:13:53 -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:327818 Archived-At: No constructive comments from me, but this thread got me tinkering with `co= nd*'. I'm embarassed to say that I spent too much time on this little snippet: (cond* ((bind* (foo 1) (bar 2)) :non-exit) ((eq foo bar) :eq) ((< foo bar) :lt) (t :nothing)) In my mind, this should return `:lt', but it returns `:nothing'. After scra= tching my head, I looked at the code and it seems that it conflicts with the manual entry: "If a clause has only one element, or if its first element is =E2=80=98t=E2= =80=99, or if it ends with the keyword =E2=80=98:non-exit=E2=80=99, then this clau= se never exits the =E2=80=98cond*=E2=80=99 construct." Apparently, if a clause returns any keyword, it does a passthrough (see `co= nd*-non-exit-clause-p' ?) Changing to this works: (cond* ((bind* (foo 1) (bar 2)) :non-exit) ; works with and without :non-exit ((eq foo bar) "eq") ((< foo bar) "lt") (t :nothing)) ;; returns "lt" Anyway, sorry if this is off-topic.