Arrays and collections / Arrays

(def numbers [1 2 3 4 5])

;; mapv gives a vector back, map gives a lazy seq
(def tripled (mapv #(* % 3) numbers))
;; tripled is [3 6 9 12 15]
(println tripled)

;; ->> threads the collection through a chain of steps
(println (->> tripled (map #(* % 2)) vec))
;; [6 12 18 24 30]

;; keep drops the nils along the way
(println (keep parse-long ["1" "2" "three"]))
;; (1 2)