From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Sat, 02 Dec 2023 09:02:05 +0000 Message-ID: <87jzpxq8oi.fsf@posteo.net> 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> <87v89ht2s4.fsf@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5843"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Richard Stallman , Lynn Winebarger , dmitry@gutov.dev, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 02 10:03:11 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 1r9Lu3-0001CP-F9 for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Dec 2023 10:03:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9LtH-00071f-Ro; Sat, 02 Dec 2023 04:02:23 -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 1r9LtF-00071M-5X for emacs-devel@gnu.org; Sat, 02 Dec 2023 04:02:21 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9LtC-0003W4-7X for emacs-devel@gnu.org; Sat, 02 Dec 2023 04:02:20 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B40D5240101 for ; Sat, 2 Dec 2023 10:02:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1701507727; bh=hYbdP8CyrcMX5lpz/gkEJDA0+Dq5qY8dYmETIfIYrB4=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=gL4IMttrXRn6o3VWqZhpHnRN5Oj2kwAKgM6ONOt2MSBwpqGaiJJ4/hl+qHnkKjGZ9 Ng9XrRVu3xUcWbSz0PFoosFzGd5hn9bXwsDyjyxXthGFW++AjPT3NsUqIdNO+J5oic 6+K+LVMnXnaL8Rxqo+D48QGCwm0JFn0/jObJjc+K3Ekt8Ex3X2MmBbiDUwQNERvPC9 iilERH3eWBVCHVyHY5tStbMP5bwBR2u4hD3ir2ZmkIJQz7/Zonv4jCg1/3AzmT7tLw uZub75sRzftiwKNhiBhypVTr8cYhtMYvw9t6CW5n6XZ8dF4RS8wrAcU1O2Q9Qs3m10 LITaM0/zl59WQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Sj3pQ2KPWz6tw9; Sat, 2 Dec 2023 10:02:06 +0100 (CET) In-Reply-To: <87v89ht2s4.fsf@linux-m68k.org> (Andreas Schwab's message of "Sat, 02 Dec 2023 09:41:15 +0100") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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:313463 Archived-At: Andreas Schwab writes: > On Dez 01 2023, Richard Stallman wrote: > >> confusing. I know what dotted pairs mean, but I was not sure what >> they meant in pcase patterns. > > They don't mean anything. It's pure lisp syntax. Right, the doc-string mentions this as well: --8<---------------cut here---------------start------------->8--- -- `QPAT Backquote-style pcase patterns: `QPAT QPAT can take the following forms: (QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr. [...] --8<---------------cut here---------------end--------------->8--- Just like cons-cells are the "real" constituents of a list, so pattern-matching on a list "really" means pattern matching on cons-cells. I believe this is the kind of behaviour that would arise naturally, whenever someone tries to re-implement this themselves. As has been said many times already in this thread: All of this seems to point in the direction that the main issue people are having is that of documentation, and part of the problem might be that pcase is generating its doc-string dynamically, which -- while cool -- might not present the information in the most understandable way. Another question I meant to raise, and forgive me if I missed it somewhere in the remaining discussions, is those who find themselves confused by `pcase': Do you have experience with programming languages that heavily rely on pattern matching and/or unification (ML, Haskell, Prolog, ...)? Myself having experience with this kind of programming, all I had to do to understand `pcase' was to translate the existing abstract notion I had to the syntax that `pcase' provides. While I can imagine that one is more prone to be confused, if trying to learn both the syntax and the point of `pcase', assuming that this kind of articulating oneself is not natural.