Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

104 lines (95 sloc) 3.108 kB
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
# one:
# column: value
#
# two:
# column: value
map:
id: 1
namespace_id: 1
name: map
url_friendly_name: map
file: clojure/core.clj
line: 2079
arglists_comp: "[f coll]|[f c1 c2]|[f c1 c2 c3]|[f c1 c2 c3 & colls]"
added: "1.0"
doc: "Returns a lazy sequence consisting of the result of applying f to the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments."
source: "(defn map
\"Returns a lazy sequence consisting of the result of applying f to the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments.\"
{:added \"1.0\"}
([f coll]
(lazy-seq
(when-let [s (seq coll)]
(if (chunked-seq? s)
(let [c (chunk-first s)
size (int (count c))
b (chunk-buffer size)]
(dotimes [i size]
(chunk-append b (f (.nth c i))))
(chunk-cons (chunk b) (map f (chunk-rest s))))
(cons (f (first s)) (map f (rest s)))))))
([f c1 c2]
(lazy-seq
(let [s1 (seq c1) s2 (seq c2)]
(when (and s1 s2)
(cons (f (first s1) (first s2))
(map f (rest s1) (rest s2)))))))
([f c1 c2 c3]
(lazy-seq
(let [s1 (seq c1) s2 (seq c2) s3 (seq c3)]
(when (and s1 s2 s3)
(cons (f (first s1) (first s2) (first s3))
(map f (rest s1) (rest s2) (rest s3)))))))
([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))))))"
weight: 2
created_at: 2010-07-14 20:22:06
updated_at: 2010-07-21 02:31:05
shortdoc: Returns a lazy sequence consisting of the result of applying f to the
dummy:
id: 2
namespace_id: 2
name: dummyname
url_friendly_name: dummyname
clojure_core_dummy:
id: 3
namespace_id: 2
name: clojure.core
url_friendly_name: clojure.core
clojure_core_plus:
id: 4
namespace_id: 1
name: "+"
url_friendly_name: "+"
file: "clojure/core.clj"
line: 809
arglists_comp: "[]|[x]|[x y]|[x y & more]"
added: "1.0"
doc: "Returns the sum of nums. (+) returns 0."
source: "(defn +
\"Returns the sum of nums. (+) returns 0.\"
{:inline (fn [x y] `(. clojure.lang.Numbers (add ~x ~y)))
:inline-arities #{2}
:added \"1.0\"}
([] 0)
([x] (cast Number x))
([x y] (. clojure.lang.Numbers (add x y)))
([x y & more]
(reduce + (+ x y) more)))"
weight: 0
created_at: 2010-07-14 20:20:59
updated_at: 2010-07-21 02:31:04
shortdoc: "Returns the sum of nums. (+) returns 0."
Jump to Line
Something went wrong with that request. Please try again.