From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Fri, 1 Dec 2023 18:45:48 +0000 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> <83fs0navpj.fsf@gnu.org> <838r6ebfhw.fsf@gnu.org> <83msuu9m2y.fsf@gnu.org> <83il5i9e49.fsf@gnu.org> <241fce6d-fbb6-aa7c-b0b5-5a654eec023d@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7696"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , owinebar@gmail.com, rms@gnu.org, philipk@posteo.net, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 01 19:43:18 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 1r98Tu-0001rJ-1q for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Dec 2023 19:43:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r98Tj-0007Wz-35; Fri, 01 Dec 2023 13:43:07 -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 1r98Tf-0007VQ-6x for emacs-devel@gnu.org; Fri, 01 Dec 2023 13:43:03 -0500 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r98TY-0000Ca-2v; Fri, 01 Dec 2023 13:42:57 -0500 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50bca79244fso3505108e87.3; Fri, 01 Dec 2023 10:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701456172; x=1702060972; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tGtTr/gacxxtln9gflxGuuCjB0KRxKfShrhJDvRYJJc=; b=aGcYctpuzR/Cgv/xyYxqfPIDQuNfkP+Tcue6sNk0wTLgNdE5WgWjB1x307OGLWjPRj AT9X0XCyVpmyCB+Xyk78cEwbKJmtwj4tcKc5ZFB6lIKMd8nsdJo+XJRQYucaOZEQdbFL G58M/lQYr2En1m8AMAWZ3Jx8AhLP0alcHs8t/nhZvVZBIqOVHSAPEe0woeh2jmOoANLG djUtIsqfonyTOXFnhPelf/v05qDP2pMDGSXMpvjIrXZ4bRlLBEy1Q7FH/WOAi0Z6R7ll rwNfAh3KCjtsfN6PHLemwEK1A65s1yyxsIUcEG8AbLG0H8oT5TswXhuN82tQmbZEX3hg /X6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701456172; x=1702060972; h=content-transfer-encoding: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=tGtTr/gacxxtln9gflxGuuCjB0KRxKfShrhJDvRYJJc=; b=NXR5e7bdaVW3j8C4rLa/aeYH4m9WD+QYuv1+abLk1tTxOFohax2i/wKuksOJdYUTVE gKH+TBQFs4+9dNTB0SJ9C6zho64A3YywTjXrCaxtr2tcgkTW6hY87PeyVvyag+o/o48V yYYhBXTPo0kBf98QKGAzUfNsRlRG1xABi4npuy1A664ipRrmrmsKEvfEH2+9K13QM/Um 3nLpenFpx/s/TPe/xEEBvh3nRWishKyIyp4hcERFQ5+FxXmvCS/N/TYZIqrsTz/urz6l /vBzfm5NTSjf/X481ob4t6LtmA858DOzzXL1TPOkOWp314Be8GLZADY4xIK8q0TQUAqh z7qQ== X-Gm-Message-State: AOJu0YzgG5lF77X9oJuXLRKzpePfhyrhDPNZ4m78Z0sHIghyhVakL92t SgoUjhYdBs4PKTp3sMPVar6jcrsh4ctSWoqb2cQ= X-Google-Smtp-Source: AGHT+IFdyqncKLe4Dzo2f/F3WAe6W2+UQTbW7tBWSlPIof0Z6Qb1RTo+0/RHewm0+RPkEahNqvV9q88GWbrXylZZyG0= X-Received: by 2002:ac2:5472:0:b0:50b:c164:8481 with SMTP id e18-20020ac25472000000b0050bc1648481mr1048878lfn.36.1701456171764; Fri, 01 Dec 2023 10:42:51 -0800 (PST) In-Reply-To: <241fce6d-fbb6-aa7c-b0b5-5a654eec023d@gutov.dev> Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x12a.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, 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:313451 Archived-At: On Fri, Dec 1, 2023 at 6:28=E2=80=AFPM Dmitry Gutov wrot= e: > That just reaffirms my understanding that the main problem with 'pcase' > that we have is documentation. The nodes are written very bottom-up, > whereas what's really needed for someone to understand the core usage, > would look more like the first half of the node "Destructuring with > =E2=80=98pcase=E2=80=99 Patterns". +1 Instead of "11.4 Pattern-Matching Conditional", that section could be called "Pcase and friends" or "The pcase family of macros family". Though it is original use of pcase, pcase conditionals are just one of the things you can do with it, and in my recent experience, not necessarily the most common or useful one. Also 'pcase-let' is probably easier to understand than 'pcase', as it only does destructuring and binding whereas the other macros do that and something more on top. Besides renaming, that section could start with a 11.4.1 "quick-start" with some brief explanation about how pcase relates to backquote-and-tick and with an example for 'pcase-let', not unlike the one that surfaced here. If space allows, an example for 'pcase' that introduces the conditional macro can be added. Jo=C3=A3o