From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: pcase-setq Date: Mon, 12 Oct 2015 14:36:30 +0200 Message-ID: <87a8roxnzl.fsf@web.de> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444653452 17984 80.91.229.3 (12 Oct 2015 12:37:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Oct 2015 12:37:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 12 14:37:23 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 1ZlcLw-0006yU-Bn for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 14:37:20 +0200 Original-Received: from localhost ([::1]:55094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcLv-0007ps-QH for ged-emacs-devel@m.gmane.org; Mon, 12 Oct 2015 08:37:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcLX-0007pa-Ji for emacs-devel@gnu.org; Mon, 12 Oct 2015 08:36:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlcLR-00037j-TF for emacs-devel@gnu.org; Mon, 12 Oct 2015 08:36:55 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcLR-00037e-ML for emacs-devel@gnu.org; Mon, 12 Oct 2015 08:36:49 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZlcLO-0006Q5-B3 for emacs-devel@gnu.org; Mon, 12 Oct 2015 14:36:46 +0200 Original-Received: from ip-90-186-2-115.web.vodafone.de ([90.186.2.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2015 14:36:46 +0200 Original-Received: from michael_heerdegen by ip-90-186-2-115.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Oct 2015 14:36:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-186-2-115.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:PrGS+bTBLvaCSxZ0r+L88vKcQOA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:191324 Archived-At: Nicolas Petton writes: > I don't know if it that's what you are looking for, but seq.el has > `seq-let` and map.el has `map-let`, and they both use pcase. > > (seq-let (a b (c &rest others)) '(1 2 [3 4 5 6]) > (+ a b c)) > > (map-let (foo bar baz) '((foo . 1) (bar . 2)) > (should (= foo 1)) > (should (= bar 2)) > (should (null baz))) What I want is a _setter_ macro using pcase, not a binding construct (sorry, I was confused about what `cl-destructuring-bind' does). Like this: (pcase-setq (seq a b (seq c)) '(1 2 [3 4 5 6])) (+ a b c) ==> 6 Michael.