;next is used to recur over the given list. it returns nil when the end of the list is reached (which is checked for in the cond statement).
(defn my-map
([functor a-list]
(cond (= a-list nil) nil
:else (cons (functor (first a-list))
(my-map functor (next a-list))))))
;next is used to recur over the given list. it returns nil when the end of the list is reached (which is checked for in the cond statement).
(defn my-map
([functor a-list]
(cond (= a-list nil) nil
:else (cons (functor (first a-list))
(my-map functor (next a-list))))))