Closed bobbicodes closed 11 months ago
Now that map has been implemented as a single multiarity function, it shouldn't be too hard to add an arity that accepts any number of args:
map
([f c1 c2 c3 & colls] (let [step (fn step [cs] (lazy-seq (let [ss (map seq cs)] (when (every? identity ss) (cons (map first ss) (step (map rest ss)))))))] (map #(apply f %) (step (conj colls c3 c2 c1)))
The main difference is that our map uses loop, but that might not be a problem since this arity just calls the others.
loop
Now that
map
has been implemented as a single multiarity function, it shouldn't be too hard to add an arity that accepts any number of args:The main difference is that our
map
usesloop
, but that might not be a problem since this arity just calls the others.