Ambrose Bonnaire-Sergeant writes:
> Sure, but I'm sceptical whether this is a good idea/intended.
> I'm pretty sure this is undocumented behaviour.
Ah, good point. I was working off of a few assumptions, some of which
were incorrect:
1) destructuring kwargs as a map was documented, but
http://clojure.org/special_forms#Special%20Forms--Binding%20Forms%20(Destructuring)[1]
currently makes no mention of it. Is it documented anywhere?
2) destructuring worked consistently in let bindings and fn args - any
destructuring that worked in one would work in the other. I believe
this was true in 1.4.0, but is no longer true, which led to my
patch.
3) destructuring worked consistently across collection types - vector
binding works with anything nthable, map binding works with
anything associative. I assumed that when kwarg map binding was
added, it supported anything seqable, but that is not the case - it
only supports ISeqs.
So the bigger questions are: should destructuring be consistent in
both usage and collection support? Should kwarg map binding be
documented?
If the status quo on those questions stands, then my patch should
probably not be applied. If it is decided that destructuring should be
consistent (in both ways above), then my patch should probably be
replaced with a patch that makes map binding work on anything seqable.