Changes for clojure.core/next

steveminer on Wed, 01 Jun 2011
;; next is used in the recursive call.  (This is a naive implementation for illustration only.  Using `rest` is usually preferred over `next`.)

(defn my-map [func a-list]
  (when a-list
    (cons (func (first a-list))
          (my-map func (next a-list)))))
steveminer on Wed, 01 Jun 2011
;; next is used in the recursive call.  (This is a naive implementation for illustration only.)

(defn my-map [func a-list]
  (when a-list
    (cons (func (first a-list))
          (my-map func (next a-list)))))
boxie on Sat, 06 Nov 2010
;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))))))
boxie on Sat, 06 Nov 2010
;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))))))