Usually, when you want to return a collection or map or another “single value” that is not seq from a “repeated” generalized operation in seq, using reduce more idiomatic / direct than loop/recur , and for always returns seq (not a collection or map).
(reduce conj #{} (for [i (range 10) j (range 10)] [ij]))
note that (for ..) is used here only to create a seq containing all the values to compile into a single set result. Or, for example:
(reduce + 0 (range 100)) => 4950
Joost diepenmaat
source share