Skip to content

Commit

Permalink
map in core.cljs first is test
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlopez committed Mar 1, 2015
1 parent 181421f commit c945fb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core.cljs
Expand Up @@ -239,3 +239,10 @@ called."
(if (= (.length vals) 0)
nil
(.create js/lists (vals))))))

(defn map
[f coll]
(let [s (seq coll)]
(if (nil? s)
nil
(cons (f (first s)) (map f (rest s))))))
1 change: 1 addition & 0 deletions test/is/map.cljs
@@ -0,0 +1 @@
(println "Map Function Tests")(is (= (map inc [1 2 3]) [2 3 4]))
Expand Down

0 comments on commit c945fb4

Please sign in to comment.