1. Summary
Is it possible to destructure an unordered plist in cl-loop
's for
-clauses?
2. Details
From the documentation I would have expected destructuring to be universal, e.g. I would have expected
for (a . b) = data
and
for (a &rest b) = data
to do the same thing, and
for (&key a b) = '(:a 1 :b 2 :c 3)
to effectively allow destructuring plists. This doesn't seem to be the case.
3. Example
Consider the snippet
(cl-loop for plist in '((:a 1 :b 2 :c 3) nil)
for (&key a b) = plist
collect (vector a b))
I would have expected the result to be
([1 2] [nil nil])
and instead I get
([1 :b] [nil nil])
i.e. &key
is treated as a variable name, not as an argument list keyword.