3 ms·
This is a good article. One gotcha I ran into using fnil is that you don't get variable-arity functions for free from it in Clojure (YMMV in cljs). This caused
by djtango 8y ago
This is a good article. One gotcha I ran into using fnil is that you don't get variable-arity functions for free from it in Clojure (YMMV in cljs).
This caused an issue when I was using (fnil + 0 0) in a reduce function - as it would barf on an empty collection - I got around this by providing an init value to the reduce call, but it caught me off guard when (reduce + []) works