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: Sun, 19 Dec 2021 23:43:04 -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="13329"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Andrew Hyatt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 20 05:47:38 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 1mzAaI-0003JD-SK for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Dec 2021 05:47:38 +0100 Original-Received: from localhost ([::1]:45014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzAaH-0008HH-DF for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Dec 2021 23:47:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzAVs-0000vv-W5 for emacs-devel@gnu.org; Sun, 19 Dec 2021 23:43:07 -0500 Original-Received: from [2001:470:142:3::e] (port=57074 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 1mzAVs-0005r7-Nk; Sun, 19 Dec 2021 23:43:04 -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=NWDKJ6uwOIeSMMZ3nI/rC6Ylt9s++bIrRQkA2E+/KuY=; b=oz9Lgs5A3mv2 atPcNf5WZMZqTU9HCS5Twk+P0YWa26izsCJ0dbAvhNX9n0F6IarsnYhfka+VvyC7vJlqpW20O2eNF 80YJk63a7iC8DxJ1VSooMpK9nVWeflO5bTV81+fv50o8fqRRDZ/hUR4zxWb0raZr5j+f0x6FfMOX5 BBXSpBtWPpccOPYDlV81dLp34zh2x56bK2zrVed+4mJfgp8G1lkEIlXIq2UzGPwIZX/PZEMnreg+p CNTWaU6EVGkyzi1AIFP1TbY24MKO7vWy8LJz5bnfqPBLK4qIPAoqCszWIyn+KZjM1fNZv5o6ZJRhr ZKuuiVcOs2OfhcyU+vTbwg==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mzAVs-0005BX-MK; Sun, 19 Dec 2021 23:43:04 -0500 In-Reply-To: (message from Andrew Hyatt on Sat, 18 Dec 2021 23:53:10 -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:282502 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 see a substantive drawback with this way of defining functions. Where is "the definition of mytest"? What place should commands take you to, when you ask to move to the definition? What if different cases are defined in different files? That would be very confusing. Another confusing thing is that it doesn't work anything like `pcase'. There is a benefit to putting all these cases into one form: (defun mytest (&rest args) (CASE-CONSTRUCT args (PATTERN ;; Match on 'a 'b with the third argument a wildcard "a b match") (PATTERN ;; Match on 'c binding VAR, with the third argument a wildcard (format "c %s match" var)) )) That adds two additional lines, and three spaces of indentation, and it avoids cans of worms. -- 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)