[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

destructuring-bind for subset of plist

From: Sam Halliday
Subject: destructuring-bind for subset of plist
Date: Wed, 25 May 2016 14:23:12 -0700 (PDT)
User-agent: G2/1.0

Hi all,

This causes an error

      (&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,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]