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: Thu, 09 Jul 2015 15:34:00 +0200 Message-ID: <878uap5ubb.fsf@gnu.org> References: <87wpyaet7r.fsf@web.de> <87y4iqh7x0.fsf@web.de> <87oajmld49.fsf@gnu.org> <87oajlyif9.fsf@gnu.org> <874mldwt7y.fsf@gmail.com> <878uapy6r9.fsf@gnu.org> <87a8v5bk20.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436451390 23962 80.91.229.3 (9 Jul 2015 14:16:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2015 14:16:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 09 16:16:22 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 1ZDCcc-00071z-Kn for ged-emacs-devel@m.gmane.org; Thu, 09 Jul 2015 16:16:18 +0200 Original-Received: from localhost ([::1]:40148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDCcb-0003Ld-Om for ged-emacs-devel@m.gmane.org; Thu, 09 Jul 2015 10:16:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBxn-0003kZ-Sd for emacs-devel@gnu.org; Thu, 09 Jul 2015 09:34:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDBxi-00077e-M6 for emacs-devel@gnu.org; Thu, 09 Jul 2015 09:34:07 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:42881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBxi-00077U-FE for emacs-devel@gnu.org; Thu, 09 Jul 2015 09:34:02 -0400 Original-Received: from thinkpad-t440p (dhcp172.uni-koblenz.de [141.26.71.172]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id E71CA1A83AC; Thu, 9 Jul 2015 15:34:00 +0200 (CEST) Mail-Followup-To: Thierry Volpiatto , emacs-devel@gnu.org In-Reply-To: <87a8v5bk20.fsf@gmail.com> (Thierry Volpiatto's message of "Thu, 09 Jul 2015 14:19:03 +0200") 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.6.x X-Received-From: 141.26.64.15 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:187790 Archived-At: Thierry Volpiatto writes: >> As I've said, you can use cdr-matching with a don't-care-pattern, >> e.g., >> >> (pcase-let ((`(,a ,b . ,_) (file-attributes "~/.emacs"))) >> (list a b)) >> >> which clearly states that you know that the list returned by >> `file-attributes' has more than two elements but you are only interested >> in the first two. > > Ah! Ok so the dont-care-pattern handle all the remaining elements. No, the crucial part is the dot separating the front from the rest of the list. With `(,a ,b . ,r) the list of the 8 remaining file attributes would be bound to r. When you don't need those, you can omit the binding with the don't care pattern. Bye, Tassilo