Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Clojure Programming/Examples/API Examples/Sequence Building

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

conj user=> (conj [1 2 3] 4) [1 2 3 4] user=> (conj '(:a :b :c) \d) (\d :a :b :c) concat (defn poly-expand poly-expand [points] (loop [aa (first points) remaining (rest points) built (empty points)] (if (empty? remaining) (concat built [aa (first points)]) (recur (first remaining) (rest remaining) (concat built [aa (first remaining)]))))) (poly-expand '[a b c d]) -> [a b b c c d d a] merge Combine two maps into a more massive map (merge {:a 1} {:b 2}) => {:a 1, :b 2}) (merge-with + {:a 1} {:a 2, :b 3}) => {:a 3 :b 3}