From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Mon, 20 Nov 2023 21:14:48 -0800 Message-ID: <4280350f-c125-9a99-e9b2-abce47f0f0e3@gmail.com> References: <87fs169mjj.fsf@posteo.net> <093f11a1-57c2-5e56-d39b-26fef1c67cbb@gutov.dev> <25942.25061.217864.329049@retriever.mtv.corp.google.com> <87zfzdcz6z.fsf@posteo.net> <763f067b-4ca9-1eba-9f3c-424c38589e9c@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14080"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, emacs-devel@gnu.org To: rms@gnu.org, Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 21 06:15:49 2023 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 1r5J6z-0003X4-LR for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Nov 2023 06:15:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5J6C-0003BJ-0t; Tue, 21 Nov 2023 00:15:00 -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 1r5J69-00039N-66 for emacs-devel@gnu.org; Tue, 21 Nov 2023 00:14:57 -0500 Original-Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5J62-0006jv-M1; Tue, 21 Nov 2023 00:14:56 -0500 Original-Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b833e11c96so174571b6e.0; Mon, 20 Nov 2023 21:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700543689; x=1701148489; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=mkqRNUXcmq+0WC+xTCtboIRUJcGr0ss7zK7i1i7ImpU=; b=OJdnoGlxtijMaBGkhCqm2fBaZ+CeHrMqS5zM170nrFjbbMZmjh/3IvW+J9deHD2AQ9 SVIX61aVlCgMGbqFQGvpgSp2E0o7WPD10+bEPkv7j9VmesYVKKodnKv6Z3Q2RYlsAkhc PFWYhK84pE/pN9gDN2s7LXa9zWEI6Ezn+spTehZh+5q0tDoIQPpS09g9O47XtoEiR1t8 xIp8twSy+ELTfai1exl8erQJ5OZ0ySBey6KsnvjW1PVcq4+2nlDsvdRUbX0CRDxNiRG0 JTHqofIaRvsRDlR5zA4Fs8kkovXeFP+BjaIIUx7zoC9fPqvDEXosmF8TH0J/RNVwupfO kUMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700543689; x=1701148489; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mkqRNUXcmq+0WC+xTCtboIRUJcGr0ss7zK7i1i7ImpU=; b=QaKQ2hW/VybG02DljfKAyg2k930D3pq0adT8UxDbUhcIh+w7iVSe663564sCERj4dE SE6+qnVhzwuoviG2XdNtXSnikzcXAB1EkkRlxffcgTgRFV1ZhHTHbB8ffaOyVWu+eTD7 H63VisO9CyWvOUx3X2hQhT05eCa9noJSV+09pPQY4vqUiM2sMRNNEKZ7GqlENrpVyutZ ofUx4ywWJwWXSN4b6+FvpeRo2rr2dV8VkCxTxo6tJPD8OjJ9m9+9xY4P8WMoX3hgabvF gY2F223fmraYM8aMqFSYj2+MoY+bmt/h98wsPvfi8NUmzRzsnmbAL6KZNOjuvjfjOWSH U0AA== X-Gm-Message-State: AOJu0YxKfDXYAU8ShOFT1+SJyOxINT3pbE9ztPR8pvmjz5T/yyiXRqNb qbz6IQehLcIf1cVEwL0Bjyp3Aol+4sw= X-Google-Smtp-Source: AGHT+IFHEKitKqsdtQ1QMtnhwI26AZY0tSC3N/dYd+AGQf6OQur69wy5k75HjeJdk8VohDpTxbe0qQ== X-Received: by 2002:a05:6808:f8e:b0:3ad:ff3e:d25c with SMTP id o14-20020a0568080f8e00b003adff3ed25cmr4915468oiw.53.1700543688887; Mon, 20 Nov 2023 21:14:48 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id p17-20020a056a000b5100b006889511ab14sm6978799pfo.37.2023.11.20.21.14.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Nov 2023 21:14:48 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=jporterbugs@gmail.com; helo=mail-oi1-x22e.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:313090 Archived-At: On 11/20/2023 6:42 PM, Richard Stallman wrote: > I uderstand that when you say it, but when I saw the line > >> > (`(,hookfun . (,start ,end ,collection . ,plist)) > > I was not sure which part of the line that rule applies to. > > In particular, what is the reason for the period and inner > parenthsses? Why doesn't the code say this? > >> > (`(,hookfun ,start ,end ,collection . ,plist) > > Would that be equiva;ent? Yes, These are equivalent (unless I'm severely mistaken): ---------------------------------------- (pcase '(func 0 10 coll plist1 plist2) (`(,hookfun . (,start ,end ,collection . ,plist)) (message "hookfun = %s start = %s end = %s collection = %s plist = %s" hookfun start end collection plist))) => "hookfun = func start = 0 end = 10 collection = coll plist = (plist1 plist2)" (pcase '(func 0 10 coll plist1 plist2) (`(,hookfun ,start ,end ,collection . ,plist) (message "hookfun = %s start = %s end = %s collection = %s plist = %s" hookfun start end collection plist))) => "hookfun = func start = 0 end = 10 collection = coll plist = (plist1 plist2)" ---------------------------------------- > I could not assume the inner parenthsses were unnecessary. Maybe > there was a conventiob by which they change the meaning. > I did not know. I think this might be a case where the 'pcase' code was written in a more-cryptic-than-necessary manner, which adds extra confusion. This could be a good example to include in some documentation though: it can show how one's intuition about "ordinary" backquoted forms can apply directly to reading 'pcase'.