From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: pcase-dolist Date: Fri, 10 Jul 2015 15:04:19 -0400 Message-ID: References: <87wpyaet7r.fsf@web.de> <87y4iqh7x0.fsf@web.de> <87oajmld49.fsf@gnu.org> <87oajlyif9.fsf@gnu.org> <87vbdsm5r9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436555201 8957 80.91.229.3 (10 Jul 2015 19:06:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 19:06:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 10 21:06:29 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZDdcy-0000WY-9R for ged-emacs-devel@m.gmane.org; Fri, 10 Jul 2015 21:06:28 +0200 Original-Received: from localhost ([::1]:45849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDdcx-0004ug-G3 for ged-emacs-devel@m.gmane.org; Fri, 10 Jul 2015 15:06:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDdct-0004uX-G7 for emacs-devel@gnu.org; Fri, 10 Jul 2015 15:06:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDdco-0005cu-Gp for emacs-devel@gnu.org; Fri, 10 Jul 2015 15:06:23 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:59360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDdco-0005cU-9E for emacs-devel@gnu.org; Fri, 10 Jul 2015 15:06:18 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id A19719C18C; Fri, 10 Jul 2015 15:06:17 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id BD3571E5B94; Fri, 10 Jul 2015 15:05:54 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 0E28CB407B; Fri, 10 Jul 2015 15:04:19 -0400 (EDT) In-Reply-To: <87vbdsm5r9.fsf@gnu.org> (Tassilo Horn's message of "Fri, 10 Jul 2015 16:44:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.81, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_POURMOI 0.01, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187801 Archived-At: > Yes, but those don't have pcase in their name. As mentioned earlier, I agree that the name is misleading (and it didn't occur to me, because to me "pcase-" is just a prefix) this name is only used because pcase-let uses the same pattern syntax and underlying machinery as `pcase'. We could rename it to `plet' (or even to just `let'). > Hm, when you said that a better name for `pcase-dolist' was `dolist', > wouldn't `let(*)' be a better name for `pcase-let(*)', too? Yes. 2 reasons why it's not done: - just as for dolist, I haven't made that jump (yet?), it's one of those things where there's no going back, so I need to work up my courage and convince myself it's worthwhile. - since `let' is currently a builtin element, and used in the expansion of pcase-let, there are some technical details that'd need to be resolved (the technical issues for dolist are trivial in comparison). > It would be very useful to be able to destructure in usual lets (like, > e.g., in Clojure). That's why I introduced pcase-let. > AFAICS, the only thing that `pcase-let' is lacking is the ability to > introduce locals without providing a value, e.g., > (let ((x 1) b c) ...) I tend to dislike these things, so I intentionally didn't add support for them in pcase-let, but it'd be trivial to support them. Stefan