From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: Semantic of pcase `seq' and `map' patterns Date: Mon, 12 Oct 2015 15:55:13 +0200 Message-ID: <87twpwkx8e.fsf@petton.fr> References: <87wpyaet7r.fsf@web.de> <87y4iqh7x0.fsf@web.de> <87oajmld49.fsf@gnu.org> <87oajlyif9.fsf@gnu.org> <87a8v53wll.fsf@web.de> <87k2qsxr73.fsf_-_@web.de> <87bnc4mh2q.fsf@petton.fr> <874mhwxne8.fsf_-_@web.de> <87si5gw6f3.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1444658164 2688 80.91.229.3 (12 Oct 2015 13:56:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2015 13:56:04 +0000 (UTC) To: Michael Heerdegen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 12 15:55:53 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 1ZldZw-0000V0-AR for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 15:55:52 +0200 Original-Received: from localhost ([::1]:55545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZldZw-0005QP-AR for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 09:55:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZldZT-00054S-5u for emacs-devel@gnu.org; Mon, 12 Oct 2015 09:55:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZldZP-0008CJ-VX for emacs-devel@gnu.org; Mon, 12 Oct 2015 09:55:23 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:45319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZldZP-0008CF-Sg for emacs-devel@gnu.org; Mon, 12 Oct 2015 09:55:19 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B71FB20D5D for ; Mon, 12 Oct 2015 09:55:19 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Mon, 12 Oct 2015 09:55:19 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=KIx282ydJ9AQUQVt04irjMZQtw8=; b=Bpxnu PF5wFAoBzuqA0qVfPVe94+a9Fqy9EIucXcjzmTl7XX3tCvmFL4h+ZP+Nl+xqlwsn f7tDC+7CIOzrfCML5IT0QAMq6ZuEJm+IwFlL76r1jvjt004WHkdl2RytVQx/ryBK Zts4eKEzS4/hcLpscE5MzMcVIHdPHyyqho4olw= X-Sasl-enc: Rnytipja2/Y/n+04+sCH5pK4ykvaEiatIvCRD8tOWmWD 1444658119 Original-Received: from blueberry (brc29-2-88-162-37-238.fbx.proxad.net [88.162.37.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E6BCC00016; Mon, 12 Oct 2015 09:55:18 -0400 (EDT) In-Reply-To: <87si5gw6f3.fsf@web.de> User-Agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/25.0.50.7 (x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 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:191335 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen writes: > It should probably also say that supernumerary elements of the object > sequence are ignored if less PATTERNS are given, and the match doesn't > fail. Yes. > > BTW, if I want to match [1 2 3 4] and bind a to 1 and b to (2 3 4), is > this possible using the `seq' pattern? Sure, using "&rest": (seq-let (a &rest b) [1 2 3 4] (format "The first is %s and the rest is %s" a b)) You can also ignore elements: (seq-let (a _ &rest b) [1 2 3 4] (format "The first is %s and the rest without the second is %s" a b)) Nico --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQEcBAEBCAAGBQJWG7vBAAoJECM1h6R8IHkQiUcH/jXCxa8NU8UATZXB1zf30PIJ cXE9q+BTfpVbXTBODH59vw1OjgLGQfHZW5ks/6kAMHW6UephlFTl2JGcqPODiqVD RtrEIUjsNR9QtiZDG+Ha1dBi0xGLVd481Wsli/99S0Y18nqcfsybqqsypNxUDcm7 CUHPmXrpuniucBfLMuv8H4b77CunYTWxKz+GujibKOhc+SClNoXYHPTmEt7MXH9T u7EvzNIjkGH5c1UEUkTGzdIfS0JbzB8uiyWJJb4xi2ZfZLzhxBHLjJwmxXAlDT1x l9Y0I67pph4BlC0IalUh99ovfvpFmWBJasygxUzZjGBc66gIwcYo2x+FV8IPJ0M= =fPkz -----END PGP SIGNATURE----- --=-=-=--