From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Code for cond* Date: Wed, 24 Jan 2024 10:29:24 -0500 Message-ID: <8E0D0E7B-B733-4CB7-A34D-7FE80D3AB52D@gmail.com> References: <1AD5807F-91F7-4B92-BCB0-D0FEA904A75D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) 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="27605"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 24 16:30:24 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 1rSfCp-00072K-Cp for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Jan 2024 16:30:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSfCB-0003B8-G6; Wed, 24 Jan 2024 10:29:44 -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 1rSfC6-0003An-W9 for emacs-devel@gnu.org; Wed, 24 Jan 2024 10:29:40 -0500 Original-Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSfC5-0006L2-Im for emacs-devel@gnu.org; Wed, 24 Jan 2024 10:29:38 -0500 Original-Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-6869d6e1d0cso11454066d6.0 for ; Wed, 24 Jan 2024 07:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706110176; x=1706714976; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wkmgYKYIkAk35eeHGMj8Peh5Gw54h2SS1HhntbxgRPM=; b=K5ZXSiyfDiFXXxqeOZ1m67e41Omq6ypTXhRRbDGK0GSwyAJ8BaEI1yBBnMrg9Df1Ak EH3V0wVs8ew0gUYivJEkRbp7Pf+iPg5n6RdoK74kAzFVlh4LxggChD+2qaXZUQ/Ipmeg 05oKxkkJl32nrHBqwj9R8GrUOVl+iewRU4cYWJJydibJoJj9lFOsVSzDGbBlSWw8UI9E w/z9EKN5fL1gHabv01IS2/rzrXQuZvjel5uPOZ5oenOnUBSq+G7DKxUan66zWq/F/riW Uc0Clu3UogKVHg0+HOfMNcMns2UyY6L+US0tyCpn9udu091rAkXrXzuQYPC/gPZnVX2T uSIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706110176; x=1706714976; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wkmgYKYIkAk35eeHGMj8Peh5Gw54h2SS1HhntbxgRPM=; b=Psv6Lk0uYK8jpKi2K4s/XqIqW03yoCqUYHnzg21SYtf6Ve9DYozn57sXRcbsdlh3xL KBSgMH00yTOLGfFObvlw4pj8L+tlv2Sav/shIIqglYeWxuS3WEtrtA399M0/i0c28jfc dtVfXIdW2ThUYgPffUGkmr4nbTfp2RS4BWVC8NnCgms5weDN5Fv/oEfHlpE9RglfpVlW qeNi3Q1L8He1m97LK1RfaK7W95GGiSlYlnKjRn1g9bsQ0m5VrkUmK2VmMcZnfHBtRWFe zR2lPYIGstmbamXX2tGPvz1GuGtZAeW54OF0KWnvFA57SB+OPXup4KOo7vOWWurZf2MQ vHyg== X-Gm-Message-State: AOJu0Yzn9RVftuRJccxT+LzbtaGLbrZDmT+pspEYRL2tMSze+D/zhG3i 38bxGUs+OiG+aFEnX7P/uag1husWsIE1xSvUmHdLJjUIAZUcpsKp X-Google-Smtp-Source: AGHT+IGWYOKGb8XpOVNi5m9vfC02WU2rhoKe52U1mxBjZoBNwVf7n2y/eiZfI3YkTa5VAN8J4UfbJQ== X-Received: by 2002:ad4:5fcf:0:b0:681:87ca:5b93 with SMTP id jq15-20020ad45fcf000000b0068187ca5b93mr2796221qvb.5.1706110176187; Wed, 24 Jan 2024 07:29:36 -0800 (PST) Original-Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id z25-20020ac81019000000b004298a09900bsm4438166qti.53.2024.01.24.07.29.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2024 07:29:35 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3774.300.61.1.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=jdtsmith@gmail.com; helo=mail-qv1-xf30.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:315317 Archived-At: > On Jan 24, 2024, at 4:45=E2=80=AFAM, Stefan Kangas = wrote: >=20 > JD Smith writes: >=20 >> But oddly enough, this thread discussing its potential replacement = has >> given me the key insight =E2=80=94 =E2=80=9Cimagine running list = interpolation >> backwards=E2=80=9D. =E2=80=A6 A short introductory paragraph in >> the elisp pcase documentation which explains this approach to its >> novel syntax would have gone a long way for me. >=20 > Patches welcome. To explain this correctly, I=E2=80=99d need to understand where the = mental model breaks down. For example, I was surprised that this = forward/reverse symmetry was not maintained: (let ((list-var '(foo moo loo)) (other 'boo)) `(,@list-var . ,other)). ; -> (foo moo loo . boo) (pcase '(foo moo loo . boo) (`(,@list-var . ,other) (format "Got %S: %S" list-var other))). ; -> nil, expected =E2=80=9CGot= (foo moo loo): boo" I also noticed that "Backquote-Style Patterns: Backquote Patterns.=E2=80=9D= is quite deep in the pcase doc structure, coming just after = =E2=80=9CExtending =E2=80=98pcase=E2=80=99: Extending pcase. Define new = kinds of patterns.=E2=80=9D. Yet most pcase examples I come across in = the wild use backquote patterns. I don=E2=80=99t know if that=E2=80=99s = an intentional arrangement, or was put in place before people had = experience with pcase and voted with their key-taps for backquote style.=20=