def names a var. let names locals for the body that follows. Both kinds of binding are immutable: there is no assignment to a local, and there is no separate const form. Later examples use atoms when a value has to change.
def
let
const
(def answer 42) (println answer) (let [x 1 y 2] (println (+ x y)))
An inner let can shadow an outer name. The outer binding is unchanged.
(let [x 1] (let [x 2] (println "inner" x)) (println "outer" x))
Bindings print the values they hold.
$ glj bindings.glj 42 3 inner 2 outer 1
Next example: Keywords and Symbols.
A hands-on tour in the style of Go by Example. Glojure is a Clojure interpreter hosted on Go.