From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Fri, 24 Nov 2023 23:15:14 -0500 Message-ID: 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 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3975"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: monnier@iro.umontreal.ca To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 25 05:16:34 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 1r6k5p-0000sq-VA for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Nov 2023 05:16:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6k4q-0001TK-4K; Fri, 24 Nov 2023 23:15:33 -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 1r6k4i-0001Sp-Fs for emacs-devel@gnu.org; Fri, 24 Nov 2023 23:15:24 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6k4d-0003HS-TJ for emacs-devel@gnu.org; Fri, 24 Nov 2023 23:15:22 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C7D0F807A4; Fri, 24 Nov 2023 23:15:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700885715; bh=znsF08L0oTxIdgzm5TujumR0645diSjlixr5rM8jr/A=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=P36RQX3BE5u/PIJc7izDPMjPVBN1RwzfOEPYHhGC3U80Egvd6+ibti62G0xAUEHKL VV8L3Z++W13KL+QNs3Tz+o9+80S8J6gre6yejENeUSitwXGen+u7EKFVAvrG/t0/oM J0NsI6mK1S6BmDGBNzEiKdXuOmWJWPRg5vr3G4jijwMhj+DoHbWaEznHigHHCdHfkr DIZeoSoSM/VQbCaulWoEEdfPuCXHzHky/eq2XoUYONjghqQZ0SgF+wfQNF9Gi8KMjq +MZQrw0staEzmChQyPDeAVg5t4DbxQegEmpU6HVegzyVsYyfHtPfe5icbN9oobI9ww fs5ljzlwP6GkA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E7CC8804F6; Fri, 24 Nov 2023 23:15:15 -0500 (EST) Original-Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C699B12034F; Fri, 24 Nov 2023 23:15:15 -0500 (EST) In-Reply-To: (Richard Stallman's message of "Mon, 20 Nov 2023 21:42:16 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:313192 Archived-At: > > To interpret those backquotes and commas, one can imagine that the they > > do the inverse of the usual. > 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. Interesting. I find this one to be very straightforward. The previous line with the `and` and the `pred` is the more problematic one. > In particular, what is the reason for the period and inner > parenthsses? Because (HOOKFUN . VALUE) is what is returned by the `run-hook-wrapped` function and (,START ,END ,COLLECTION . ,PLIST) is the format of the value returned by the hook's functions. IOW, a merely stylistic choice. > Why doesn't the code say this? > > (`(,hookfun ,start ,end ,collection . ,plist) > > Would that be equiva;ent? Interesting. `pcase` is a macro, so it does not see the above characters, it only sees the resulting Sexp returned by the Lisp reader, and as you may remember, the reader returns *exactly* the same Sexp for the above two lines of text. So `pcase` would be hard pressed to make those two *not* equivalent :-) Stefan