From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Using "pcase" as part of names is inhelpful. Date: Mon, 11 Dec 2017 09:31:21 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1513002762 5079 195.159.176.226 (11 Dec 2017 14:32:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Dec 2017 14:32:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 11 15:32:32 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOP8C-0000gO-0y for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2017 15:32:32 +0100 Original-Received: from localhost ([::1]:53536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOP8E-0001Hw-5q for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2017 09:32:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOP7H-0007oE-W5 for emacs-devel@gnu.org; Mon, 11 Dec 2017 09:31:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOP7C-0002Te-B4 for emacs-devel@gnu.org; Mon, 11 Dec 2017 09:31:35 -0500 Original-Received: from [195.159.176.226] (port=39316 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOP7C-0002ST-4I for emacs-devel@gnu.org; Mon, 11 Dec 2017 09:31:30 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eOP72-0006Ne-R4 for emacs-devel@gnu.org; Mon, 11 Dec 2017 15:31:20 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:Bv8mb/uoLeogyGzpPyxzPNA+Mhk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220878 Archived-At: > Now we are adding other constructs that use patterns to destructure > objects. These constructs have nothing to do with selecting among > cases. Thus, 'pcase' in their names makes for misleading names. Indeed, their "pcase-" is the name of the package but it can be confused with the name of the `pcase` macro. > We should give the new constructs names that fit them without a > distracting element. What would be good new names? > We could use 'plet' and 'plambda'. Or 'pattern-let' and 'pattern-lambda'. For pcase-dolist, there's little doubt in my mind that we should call it `dolist`. For pcase-let, I'd also like to call it `let`, tho there are some technical difficulties there (it would probably involve renaming the current `let` special form and providing an initial "dummy" definition of `let` as an alias for that new name during bootstrap until we get to the point where we can override it with pcase's version). OTOH I'm not so sure we want to rename pcase-lambda to `lambda` for the simple reason that I'm not completely satisfied with `pcase-lambda` and I don't see a way that would satisfy me without making it "incompatible" with `lambda` (the main issue being that &optional and &rest are themselves limited forms of pattern matching, so we'd have to either add them to pcase patterns or find some other way to combine the two). Given that there are currently very few uses of pcase-lambda, I'm pretty happy living with a suboptimal name like `pcase-lambda`. > We could follow the example of Common Lisp 'destructuring-bind', to > create 'destructuring-let' and 'destructuring-lambda'. That would make it sound like it will use CL-style patterns rather than pcase-style patterns. Stefan