Currently, the arg lists available to assoc are: ([map key val] [map key val & kvs])
And these for conj: ([coll x] [coll x & xs])
I've run into a situtation several times where I want to do (apply assoc m keyvals), but (seq keyvals) can sometimes be nil. Similarly for (apply conj coll xs). In these cases, both assoc and conj throw an ArityException because they don't have a [coll] -only signature.
I'd like it if both assoc and conj gained a ([coll] coll) method. I'd be happy to provide patches to both CLJ and CLJS, if desirable.
Has this been discussed before? (It's quite hard to search for "assoc")
Are there any reasons not to add these methods? The only thing I can think of is that (into coll xs) is idiomatic for (apply conj coll xs), but the assoc equivalent is (into coll (partition 2 xs)) which is a bit awkward.