#Clo*j*ure ## A Dynamic Programming Language for the JVM Copyright (c) Rich Hickey. All rights reserved. The use and distribution terms for this software are covered by the [Common Public License 1.0][cpl], which can be found in the file CPL.TXT at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software. [cpl]:http://www.opensource.org/licenses/cpl1.0.php ##Contents ###Introduction Clojure is a dynamic programming language that targets the [Java Virtual Machine][jvm]. It is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded server programming. Clojure is a compiled language - it compiles directly to JVM bytecode, yet remains completely dynamic. *Every* feature supported by Clojure is supported at runtime. Clojure provides easy access to the Java frameworks, and optional type hints with type inference, to ensure that calls to Java can avoid reflection. Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a [functional programming][fp] language, and features a rich set of immutable, [persistent data structures][pd]. When mutable state is needed, Clojure offers a [software transactional memory][stm] system that ensures clean, correct, multithreaded designs. I hope you find Clojure's combination of facilities elegant, powerful and fun to use. [jvm]:http://java.sun.com/docs/books/jvms/ [fp]: http://en.wikipedia.org/wiki/Functional_programming [pd]: http://en.wikipedia.org/wiki/Persistent_data_structure [stm]:http://en.wikipedia.org/wiki/Software_transactional_memory Rich Hickey ###[Setup](#setup) ###[Quick Start](#quickstart) ###[Reader](#reader) ###[Evaluation](#evaluation) ###[Special Forms](#specialforms) ###[Data Structures](#datastructures) ###[Sequences](#sequences) ###[Vars and the Global Environment](#vars) ###[Refs and Transactions](#refs) ###[Access to Java](#java) ###[Differences with other Lisps](#lisp)
(load-file "/your/path/to/boot.clj")
In the alpha, this will spew a bunch of bytecode as it compiles the file. This is to help me (and you) diagnose any code generation problems. After boot.clj is loaded you will have the language as described herein fully available.
Try:
(+ 1 2 3)
(. javax.swing.JOptionPane (showMessageDialog nil "Hello World"))