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: Thu, 31 Mar 2022 00:27:10 -0400 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="7402"; 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 Thu Mar 31 06:28:24 2022 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 1nZmQ4-0001kO-I2 for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Mar 2022 06:28:24 +0200 Original-Received: from localhost ([::1]:48702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZmQ3-00030C-2J for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Mar 2022 00:28:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZmOt-0000wf-IR for emacs-devel@gnu.org; Thu, 31 Mar 2022 00:27:11 -0400 Original-Received: from [2001:470:142:3::e] (port=50530 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 1nZmOt-0008Qm-8q; Thu, 31 Mar 2022 00:27:11 -0400 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=qHh0Yaat+Lar5FKaW35EmcS6HvzbHJHzAg/hTE7YG/Y=; b=jgpncSLKPZzq uBwP5c5U3qAJqutmJh/Q3WBe38Tk3M0lCRZAYKWeWD+Nv+ICkI4lmnUYSYNQsWt5+ljmsOd31afOh NwWcDpZjZTTJnKFo4FLcSA8XLjX4p9QRFKn3S5PzKB2erWQP+ObGe08zV+aMGR+/UOJ4W0cuC+xJo eWxo6ifn7xgZsKKSVG+ywei5y71zqLRLYdCm0Bs5vHCsep22TpY8wLyTlFEfV6vnHJkS8L/g/7OVe eC3kwPsEoEu+S1xnb8rrHdDV4b4/f4h6BtdcFNJiqN6UKRfvcjcymEbY2PEOOgNoxZe+WNyM9WVtL e/06YqDScP0eXIj7hHThoQ==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1nZmOs-0002uf-Vj; Thu, 31 Mar 2022 00:27:10 -0400 In-Reply-To: (message from Andrew Hyatt on Tue, 29 Mar 2022 21:28:00 -0400) 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:287623 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. ]]] > The way I look at it, it does do this, but it's just structured > differently. The normal defun as one arglist. Mine has one per > matching clause, which means that it can take a variety of > different arguments, all matching. And the arglist and the > matching clauses are the same thing, so the arglist can be (n), or > ('foo n), or (1 2 (3 n)), etc. Yes, it's weird, but I think the > differentiation here is useful, see my next point. The argument list is not just a concept in users' minds. The command C-h f, which shows documentation for a function, displays the function's argument list. If you try C-h f cons RET, you'll see what I mean. See also `func-arity'. So there is a practical reason for defining constructs to set up the function's argument list. > In particular, with your > proposal, we lose the ability to have fairly different arg > patterns, with different numbers of args, or different > destructuring patterns. Not necessarily. You could specify `&rest args' for an arglist that conveys no information. But users find it useful to see in a simple way what the arguments of the function should be. -- 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)