announcements

Project/library announcements ONLY - use threaded replies for discussions. Do not cross post here from other channels. Consider #events or #news-and-articles for other announcements.
Helins 2021-03-20T13:35:49.141400Z

Slight update to Void, a CLJC library for handling nil (especially with collections): https://github.com/helins/void.cljc

👍 4
1
⚫ 1
2021-03-21T08:15:41.144200Z

(= (void/assoc {:a 42}
                :a nil
                :b 42)
   {:a 42
    :b 42})
this is surprising, I would expect {:b 42} instead, in a way consistent with your update function.

2021-03-21T18:55:47.146Z

I had the same thought @vincent.cantin; Seems inconsistent with respect to whether nil clears out a k/v pair or just doesn't update.

2021-03-22T14:17:32.154500Z

cc @adam678

Helins 2021-03-22T14:56:31.154900Z

Indeed, assoc is a no-op in case of nil. What you describe is its sibling, assoc-strict, which does that :) I guess it should be better examplified in the README.