From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Fri, 01 Dec 2023 10:10:03 +0200 Message-ID: <83zfyu9wdg.fsf@gnu.org> 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> <83fs0navpj.fsf@gnu.org> <838r6ebfhw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22812"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joaotavora@gmail.com, owinebar@gmail.com, rms@gnu.org, dmitry@gutov.dev, philipk@posteo.net, emacs-devel@gnu.org To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 01 09:11:35 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 1r8ycZ-0005ly-35 for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Dec 2023 09:11:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8ybi-0005lu-UG; Fri, 01 Dec 2023 03:10:42 -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 1r8yba-0005hU-3c for emacs-devel@gnu.org; Fri, 01 Dec 2023 03:10:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8ybX-0003kb-9E; Fri, 01 Dec 2023 03:10:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=YuJc0YtlyIq0Qi/Dlro7E5iSWNf8Vv/EAKMXhHMGxfY=; b=USjGr1xqFTJ4eqwr0a04 x1fdBb8fdDLpufPb1bDUxvuGrNpMGJ41pzk7d4CqErai6EV1p9pmUfAFjKtwpZCNdyZ4j0hmVUSr7 MMNW23nm1PODdry7ddu/3awinjfN+53gxL+6CnwpuIjiBWTW5909PuBxO/bfPlB7Q/AOFhih/H3kw cinwQjFemkEOtmwB3pVDGRE454hWYvtVauGe4UU8tDhqCOK5HpmOiRFvGkufGC6WaPrjbOnzxUdfH 95rEwRO48L6z16V+bi4OOxdriS5btO12M2J3raOOJ0JXO5Yj3ca/X03J2YsajRjmab2W5EN9WpDuI g3phHHtF3wWcMw==; In-Reply-To: (message from Yuri Khan on Fri, 1 Dec 2023 14:07:40 +0700) 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:313425 Archived-At: > From: Yuri Khan > Date: Fri, 1 Dec 2023 14:07:40 +0700 > Cc: João Távora , > owinebar@gmail.com, rms@gnu.org, dmitry@gutov.dev, philipk@posteo.net, > emacs-devel@gnu.org > > On Fri, 1 Dec 2023 at 13:32, Eli Zaretskii wrote: > > > Incidentally, the actual code from which this were taken is > > > > (`(,hookfun . (,start ,end ,collection . ,plist)) > > > > Which has _two_ periods, not one, which are AFAIU redundant, as far as > > the Lisp reader is concerned. > > The first period and the parentheses are redundant but they are > helpful because they emphasize that the first element and the rest of > the list come from different places. > > The second period is not redundant. It causes the (,start ,end > ,collection . ,plist) to match any list of 3+ elements and the ,plist > binding to receive the remainder. Without the period, (,start ,end > ,collection ,plist) would only match a list of exactly 4 elements, and > ,plist would bind to the fourth. Exactly my point: these periods and other special characters are "magic" in pcase, but not elsewhere in Lisp. Sometimes they are just for better readability, sometimes they are significant in other ways.