Calling map with at least one empty sequence results in an empty sequence regardless of the first argument. However, a map with a non-function as the first argument is an error:
user=> (map 5 [])
()
user=> (map 5 [] [])
()
user=> (map 5 [] [1])
()
user=> (map 5 [1] [])
()
user=> (map 5 [1] [6])
Error printing return value (ClassCastException) at clojure.core/map$fn (core.clj:2777).
class java.lang.Long cannot be cast to class clojure.lang.IFn (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IFn is in unnamed module of loader 'app')
To handle this properly, we need a predicate for at least one empty sequence, and then we need to add handling of this case when an error message is generated from the spec error.
Calling map with at least one empty sequence results in an empty sequence regardless of the first argument. However, a map with a non-function as the first argument is an error:
To handle this properly, we need a predicate for at least one empty sequence, and then we need to add handling of this case when an error message is generated from the spec error.