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 08:24:10 +0200 Message-ID: <83a5qubfud.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> <87il5jgf1z.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27921"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 01 07:25:07 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 1r8wxX-00074d-9J for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Dec 2023 07:25:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8wwj-0002GJ-V7; Fri, 01 Dec 2023 01:24:17 -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 1r8wwi-0002GB-TP for emacs-devel@gnu.org; Fri, 01 Dec 2023 01:24:16 -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 1r8wwi-0004gg-Ks; Fri, 01 Dec 2023 01:24:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Aj+T+TkiC2BfagVgy2zbA27G7xqfswxmac6DzXSpqw8=; b=H1bY7BBUde/e y6N44uAR0UO33SBi7zEfaLyg5/dZKHS42Q6PCgcsPXNmuD5Fq1W8rO+fqDPEyfLh8E32hhcue8Lf+ 1FNMWKUxvkS4COyCg783EXQNwLyjyVnz2luoTFoNoW1sb9ljx+hIHD8b6wP+Ezm4gIbANr0iUAB+w p2nUnl/B+xKRc2Rpr7tW6N4rT2dZ6e59RcAJTtWn4OcZOIICjWYdRwNr8AFdMqSoDTVzSH3TVIX6i IOmp7H1gNE0Chx+k7Q120Cer44j3zpTLOaStlQvL+eD5N8E54ZahjBZGGkSTiu2oZF7TAJNuN4Gxn NVtRhPg9PN8U9MxKMiRVWA==; In-Reply-To: <87il5jgf1z.fsf@web.de> (emacs-devel@gnu.org) 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:313417 Archived-At: > Date: Thu, 30 Nov 2023 21:30:00 +0100 > From: Michael Heerdegen via "Emacs development discussions." > > Eli Zaretskii writes: > > > I think you are missing the point. The point is that pcase has so > > many semi-magical syntax features that use punctuation characters in > > creative ways that every extra punctuation character presents a > > puzzle. Faced with > > > > (`(,hookfun . ,start ,end)) > > This is not a valid expression and will be rejected by the reader. Was > it a typo or did you think this would be valid? It was taken from one of the posted examples, perhaps with a typo. But that is not relevant. Are you saying pcase doesn't have constructs like (`(SOMETHING...), or that SOMETHING doesn't use periods in places where they are redundant in "normal" ELisp code? IOW, these details are not the point, the point is something else entirely, see below. > > one immediately asks himself why the period, where in "normal" Lisp > > expressions it would be completely redundant? > > As had been said: the syntax has been chosen intentionally to underline > that it is important to view the matched thing as a cons instead of a > list. My point focuses on the problems this syntax causes to someone who doesn't have intimate knowledge and a lot of practice with pcase. Thus, it is a disadvantage. Whether it is outweighed by advantages is a separate discussion; my message just pointed out that the disadvantage exists and is real, because Lynn seemed to be missing that point. > > The fact that it is there then leaves one wondering whether that > > period has some "magical" meaning. > > As an alternative one can have a look at the docstring. It is a disadvantage if one needs to consult doc strings all the time while reading code. And in this case, the doc string is quite long and highly non-trivial (and rightfully so, since the DSL is a rather complex one). > People should familiarize themselves a bit with Lisp when working with > the Emacs Lisp source code. I know the above identity can be confusing > _once_, in different situations, not only in `pcase', but it is > something on has to know anyway, and this is really not that difficult > or magical. If one bumps into such constructs very frequently, then eventually one will become familiarized with them. But if the frequency is low enough, one could easily forget the details, and then one will need to consult the documentation again the next time. Please don't underestimate these difficulties, even if you don't share them.