From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Fri, 24 Nov 2023 12:29:12 -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: multipart/alternative; boundary="0000000000000d7bc8060ae94bb9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Philip Kaludercic , emacs-devel To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 24 18:30:10 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 1r6a0F-00007l-Pz for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Nov 2023 18:30:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6Zze-0003aP-TS; Fri, 24 Nov 2023 12:29:30 -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 1r6Zzb-0003a0-W4 for emacs-devel@gnu.org; Fri, 24 Nov 2023 12:29:28 -0500 Original-Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6Zza-0003yt-C7; Fri, 24 Nov 2023 12:29:27 -0500 Original-Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2851a2b30a2so1557882a91.3; Fri, 24 Nov 2023 09:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700846963; x=1701451763; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bC1o7QcVLbpMha/mM/w6h2pc6V+Bqrsj7ItsLXuDtXU=; b=NldJuQ2/0XAISI7mhRikt7qIw7HsNJywwPaxBEHoayDO4tlJt4agDdkomyzGvM99qW ZivuKW+UCJyBz1YYgNNJZIQMCDU4dRruM/6ja9cKAW49wsabyCcI1Xd0rxc5DF6YwoZK dDkCmhRA/ZqB+PPum/VxlzuAG0oO7JlaDQ1o4b6NZ+tgEjse5uV+S2EX7/+iVn5vtQB6 MWBvQm4SDnjiPT1FDIRLTVb9hLexFl56gcl9dyL9yfS2+SQEDBGkajIZ2Cx22VjW4Yyp SCxZpX2/6K6TinX0ID1lNP/S71urIGTkEe7wmhrCq/4xHOjvlID7Hckhn+HPr/G8FLoC qv3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700846963; x=1701451763; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bC1o7QcVLbpMha/mM/w6h2pc6V+Bqrsj7ItsLXuDtXU=; b=EhLUYPdsHkHWjFT2Qu9H3gz16IIXKRNi6xsbX8wNTti2z/NrFWbsqIzTYSalb9qHJU l0W1WvPkEza0JiitRGN/kc49wQBUsrziGfjtJcAgWTWllC1xqN0O7oUTF2MbtrmB+sAn 2rZaKxOxKr2fDrxXNkf9v9/GTeQQY5xfcK0f4QLVQ72YLiPiRvedUuuoFwjsXL/8FS/B ubEKSlT9CMfkQIq4rcIvsu2g9pzIYC+GUkDzvKMfE5rqE6evRgyr/UqfpZhdUVksLbPH ZD/ZGog2wbZC3ouQcjUi+KUMb7Vq4h5ra0JbZDb5a+oNy7Q17CeBVJEB/6wSqILekPpu PQdg== X-Gm-Message-State: AOJu0YxFzHnsynVa8OUS1mzH0zs/2D+2FHitemkwx/GicFzRMdGjxX4k pOpBtPnkLKuB+rT5g9P938gVK0HnhJezZVv9sV6SI9v1 X-Google-Smtp-Source: AGHT+IG8kPy2tE/WKPf8In7tmq4RZlVEckFVE6FSOGQU5h6UVzK/uDr3iBvWIQLomoULSBLCTpkmKWu2h0vtq6GaVzk= X-Received: by 2002:a17:90b:3b43:b0:285:8e8a:cd1c with SMTP id ot3-20020a17090b3b4300b002858e8acd1cmr2367760pjb.44.1700846963094; Fri, 24 Nov 2023 09:29:23 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=owinebar@gmail.com; helo=mail-pj1-x102d.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, HTML_MESSAGE=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:313178 Archived-At: --0000000000000d7bc8060ae94bb9 Content-Type: text/plain; charset="UTF-8" On Mon, Nov 20, 2023, 9:42 PM Richard Stallman wrote: > > > > They contain code that looks like Lisp but does not have the same > > > semantic rules as Lisp. > > > Yes: it's a domain-specific language. > > THat is why pcase adds to the total complexity of Emacs Lisp: because > it incorporates a domain-specific language. (I called it a "little > lajguage".) > > > 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. > > 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? > > 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 haven't seen anyone point this out yet, but they have to be equivalent. The reader constructs the same data structure for those concrete expressions (text) before the pcase macro is ever evaluated. I would think the author is simply emphasizing that they are parsing an entity in an association list for which hookfun is a key. Lynn --0000000000000d7bc8060ae94bb9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Nov 20, 2023, 9:42 PM Richard Stallman <rms@gnu.org> wrote:

=C2=A0 > > They contain code that looks like Lisp but does not have t= he same
=C2=A0 > > semantic rules as Lisp.

=C2=A0 > Yes: it's a domain-specific language.

THat is why pcase adds to the total complexity of Emacs Lisp: because
it incorporates a domain-specific language.=C2=A0 (I called it a "litt= le
lajguage".)

=C2=A0 > To interpret those backquotes and commas, one can imagine that = the they
=C2=A0 > do the inverse of the usual.

I uderstand that when you say it, but when I saw the line

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > (`(,hookfun . (,start ,end ,col= lection . ,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?=C2=A0 Why doesn't the code say this?

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > (`(,hookfun ,start ,end ,collec= tion . ,plist)

Would that be equiva;ent?

I could not assume the inner parenthsses were unnecessary.=C2=A0 Maybe
there was a conventiob by which they change the meaning.
I did not know.

I haven't seen anyone point this out yet, but they have to b= e equivalent.=C2=A0 The reader constructs the same data structure for those= concrete expressions (text) before the pcase macro is ever evaluated.=C2= =A0=C2=A0

I would think = the author is simply emphasizing that they are parsing an entity in an asso= ciation list for which hookfun is a key.

<= div dir=3D"auto">Lynn

--0000000000000d7bc8060ae94bb9--