From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Halliday Newsgroups: gmane.emacs.help Subject: destructuring-bind for subset of plist Date: Wed, 25 May 2016 14:23:12 -0700 (PDT) Message-ID: <06aeb16e-843c-4964-bf31-09fe16e4488d@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1464883294 13678 80.91.229.3 (2 Jun 2016 16:01:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2016 16:01:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 02 18:01:33 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1b8V3q-00014h-K9 for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2016 18:01:30 +0200 Original-Received: from localhost ([::1]:48209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8V3p-0005A9-Rl for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2016 12:01:29 -0400 X-Received: by 10.200.52.13 with SMTP id u13mr3839534qtb.19.1464211393325; Wed, 25 May 2016 14:23:13 -0700 (PDT) X-Received: by 10.50.56.240 with SMTP id d16mr1411igq.3.1464211393281; Wed, 25 May 2016 14:23:13 -0700 (PDT) Original-Path: usenet.stanford.edu!88no6314910qga.1!news-out.google.com!h125ni1557ita.0!nntp.google.com!q6no1354759igz.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=217.42.39.152; posting-account=kRukCAoAAAANs-vsVh9dFwo5kp5pwnPz Original-NNTP-Posting-Host: 217.42.39.152 User-Agent: G2/1.0 Injection-Date: Wed, 25 May 2016 21:23:13 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:217872 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110232 Archived-At: Hi all, This causes an error (cl-destructuring-bind (&key a b) '(:a "foo" :b 13 :c "bar") (list a b)) because the :c key/value is not handled in the pattern match. Often I find myself wanting to extract some subset of keys/values from a plist, but cl-destructuring-bind isn't appropriate because of this limitation. Is there a way to make cl-destructuring-bind simply ignore unmatched keys in the EXPR? I'm not sure what the official common lisp behaviour is supposed to be here, is the error in the spec? Note that the dash library has some support for a similar destructuring with -let, but that requires some boilerplate to assign a symbol to each key. Best regards, Sam