From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: pcase defuns Date: Tue, 21 Dec 2021 23:18:33 -0500 Message-ID: References: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8155"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Andrew Hyatt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 22 05:19:22 2021 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 1mzt60-0001uk-6M for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Dec 2021 05:19:20 +0100 Original-Received: from localhost ([::1]:39564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzt5y-0004o5-Vr for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Dec 2021 23:19:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzt5F-0002lg-5i for emacs-devel@gnu.org; Tue, 21 Dec 2021 23:18:33 -0500 Original-Received: from [2001:470:142:3::e] (port=52332 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzt5E-000773-Rr; Tue, 21 Dec 2021 23:18:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=7fIa5gH3oX26R3W1bVBkP15X1KagMxFENAnC+a4Tavo=; b=BfA6qbJVaSvz TJwVG0CULY4gMUFIp7NEhrJ74ch2E9nNtj+uQ0Ouy1QZWzHr2OvCxq3ObpOja0jF+ZP5ZUDbotA2o TkUQS5EyTB+zhN7YpybmOUzRnPk5N1m6nGT/UasPeajsiMjIo1qjOQ3xNdjqOUYjfSs0S97cAR285 iiMCCVUQKLIOtlneF7eELECODVQW8fEa9BMIRetofP6g94QYqkkmd/L2eicad2Mv9iZYQh5sGZI98 FVE9CqlFxA1l19Wcc5oD2DFw711NmL15ndmhmhz/jKaF3fEbvC1UKu30ay7+9+347kOBLjeJWrxnS 0PQ5EMNIiPSTjz0IbNj5hA==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mzt5F-0005ia-23; Tue, 21 Dec 2021 23:18:33 -0500 In-Reply-To: (message from Andrew Hyatt on Tue, 21 Dec 2021 00:20:41 -0500) 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" Xref: news.gmane.io gmane.emacs.devel:282673 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I agree that just implementing everything in a function is > reasonable. For that, just using pcase seems good enough, > although it might be interesting to have a very different way of > writing a function such as > (pcase-defun mytest > "Demonstrates a way of writing defuns via pcase matching." > ((a b _) "a b match") > (`(c ,v _) (format "c %s match" v))) This avoids the split-up-definition problems I was talking about, since it is all in one place with one name. Please make the defining form's name follow th convention of starting with `def', so people and tools will recognize that it is a defining form. Also, why use `pcase' in the name? According to the docs of `pcase', this pattern matching is not similar. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)