Lists are linked sequences that grow at the front. A quoted list is data. Without the quote, Glojure would try to call 10 as a function. Code itself is made of lists: the first element is the operation.
10
(def nums '(10 20 30)) (println nums) (println (first nums)) (println (rest nums)) (println (conj nums 5)) (println (cons 0 '(1 2)))
conj on a list puts the new element first.
conj
$ glj lists.glj (10 20 30) 10 (20 30) (5 10 20 30) (0 1 2)
Next example: Maps.
A hands-on tour in the style of Go by Example. Glojure is a Clojure interpreter hosted on Go.