From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: pcase-dolist Date: Fri, 10 Jul 2015 16:44:42 +0200 Message-ID: <87vbdsm5r9.fsf@gnu.org> References: <87wpyaet7r.fsf@web.de> <87y4iqh7x0.fsf@web.de> <87oajmld49.fsf@gnu.org> <87oajlyif9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436539510 12348 80.91.229.3 (10 Jul 2015 14:45:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 14:45:10 +0000 (UTC) Cc: Michael Heerdegen , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 10 16:45:00 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 1ZDZXu-0003X1-Qn for ged-emacs-devel@m.gmane.org; Fri, 10 Jul 2015 16:44:58 +0200 Original-Received: from localhost ([::1]:44914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDZXu-0004Wy-Bb for ged-emacs-devel@m.gmane.org; Fri, 10 Jul 2015 10:44:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDZXp-0004Vy-PP for emacs-devel@gnu.org; Fri, 10 Jul 2015 10:44:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDZXl-0008JM-4W for emacs-devel@gnu.org; Fri, 10 Jul 2015 10:44:53 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDZXl-0008JI-0k for emacs-devel@gnu.org; Fri, 10 Jul 2015 10:44:49 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 12E7920BA6 for ; Fri, 10 Jul 2015 10:44:47 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 10 Jul 2015 10:44:47 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:references:subject:to:x-sasl-enc:x-sasl-enc; s= smtpout; bh=4KsQ5ioEfffsZNiqV5zdtAx9/eM=; b=GU4Fx3YcSR4SlCTqrM20 qQsEksYdXB9rm4PJJcWgUAlU3nV38JxBF2hTXpJwR9vdJCOGxePKMbGmKfeAF9y/ 1H/N7cwPO3mZE/2bfnn5x75D6AmbYQfvrdldzSKinkGOKeX0TowFVNCXWpwBBQgw AaofqHuXqOlql2IIGUp9Dug= X-Sasl-enc: gOoVg30T6/xysSVRiTTfbtnjTXGRj6go3nniAgUXoRa2 1436539486 Original-Received: from thinkpad-t440p (unknown [2.163.190.209]) by mail.messagingengine.com (Postfix) with ESMTPA id C6B33680108; Fri, 10 Jul 2015 10:44:45 -0400 (EDT) Mail-Followup-To: Stefan Monnier , Michael Heerdegen , emacs-devel@gnu.org User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 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:187798 Archived-At: Stefan Monnier writes: >> Yes, if you want to pick the first two elements of a list with 2 or >> more elements, you should use `(,w ,x . ,_). I see that the above is >> slightly more convenient and concise but I'd value consistency more. > > But that does not match the usual uses of "tuples represented as > lists", where it's customary to use (A B) when the remaining fields > are all nil (since (car nil) returns nil and (nth 5 '(1 2)) also > returns nil rather than signaling an error) and where it's also > customary to ignore any additional element. Yes, but those don't have pcase in their name. If that wouldn't be the case with `pcase-let' I would not complain at all. Hm, when you said that a better name for `pcase-dolist' was `dolist', wouldn't `let(*)' be a better name for `pcase-let(*)', too? It would be very useful to be able to destructure in usual lets (like, e.g., in Clojure). I think there are gazillion of occurrences of (let* ((this-and-that (foo ...)) (this (car this-and-that)) (that (cdr this-and-that))) ...) 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) ...) but that shouldn't be too hard to add, no? Bye, Tassilo