Clojure is an [[Eclipse Public License]] licensed [[Lisp]]-family functional programming language for the [[JVM]] written in [[Java]]. - [Website](https://clojure.org/) - [Source](https://github.com/clojure/clojure) - [Documentation](https://clojure.org/guides/learn/clojure) (official) - [Documentation](https://clojuredocs.org/) (community) > Clojure is a compiled language, yet remains completely dynamic – every feature supported by Clojure is supported at runtime. # Notability A modern Lisp. Unfortunately built on the [[JVM]] and/or [[Javascript]] (for Clojurescript). # Philosophy # OS Support # Features # Syntax ## Definition Macros - `let` - generic setter, has lexical scope only within the current and children parens - `def` - generic setter, ideally single assignment but this is not enforced, technically creates a namespaced "global" - `defn` - creates a function and assigns it a name, essentially a thin layer over `def` and `fn` - `deftype` - creates a generic type that can be used with the typechecker, has fields and with typehints, can use interfaces and protocols, geared towards internal implementation details with mutable fields - `defrecord` - creates a generic type that is geared towards higher level application data with immutable fields, includes more metadata and and value-based equality ## Argument Threading These are equivalent: ```clojure ;; nested (other_func (some_func some_value 1) 2) ;; threaded ( -> some_value (some_func 1) (other_func 2) ) ``` 1. The value is passed as the first argument of the first function 2. The result of that operation is passed as the first argument of the second function 3. etc ## Quoting https://web.archive.org/web/20160304084300/https://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html # Tips # Resources - [Try Clojure](https://tryclojure.org/) online REPL and tutorial # References - https://clojure.org/reference/datatypes - https://clojure.org/reference/special_forms - https://clojure.org/guides/threading_macros