3 ms·
For people used to Scheme (or most other programming languages, I guess): note that def will create a var in the current namespace, not a locally-scoped variabl
by lvh 9y ago
For people used to Scheme (or most other programming languages, I guess): note that def will create a var in the current namespace, not a locally-scoped variable. In Scheme, or e.g. in Python, a define or = in the same spot as that def would get you a local var. In Clojure, the idiomatic way to do the same thing is normally a let or something -- but using def here makes it easy to access from a REPL running in that namespace.
(A var is a Clojure thing that holds a value. If you've ever had like a "fully qualified path" to a class or object and had to describe it as a string or whatever, that concept is a first-class thing in Clojure, and called a var.)
- lispm 9y ago> For people used to Scheme (or most other programming languages, I guess) That's what LISP did since shortly after the last dinosaurs got killed by humans.