Clojure

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire
Clojure
Paradigm Functional, Multi-paradigm
Appeared in 2007
Designed by Rich Hickey
Developer Rich Hickey
Latest release 20080916/ 2008-09-16
Typing discipline dynamic, strong
Influenced by Lisp, ML, Haskell, Erlang
OS Cross-platform
License Common Public License
Website http://clojure.org

Clojure is a dialect of Lisp that runs on the Java Virtual Machine. It is a general-purpose language sporting interactive development, and it encourages a functional programming style that enables simplified multithreaded programming. Clojure honors the code-as-data philosophy and has a sophisticated Lisp macro system.

Contents

Philosophy

Rich Hickey developed Clojure because he wanted a Lisp for functional programming, symbiotic with an established platform, designed for concurrency.

Syntax

Like any other Lisp, Clojure's syntax is built on S-expressions that are first parsed into data structures by a reader before being compiled. Clojure's reader supports literal syntax for maps, sets and vectors in addition to lists, and these are given to the compiler as they are. In other words. the Clojure compiler does not compile only list data structures, but supports all of the mentioned types directly.

Clojure is a Lisp-1, and is not intended to be code-compatible with other dialects of Lisp.

Macros

Clojure's macro system is very similar to that in Common Lisp with the exception that Clojure's version of the backquote (called "syntax quote") qualifies symbols with their namespace, this helps prevent unintended name capture as binding to namespace-qualified names is forbidden. It is possible to force a capturing macro expansion, but this must be done explicitly. Clojure also disallows rebinding global names in other namespaces that have been imported into the current namespace.

Language features

External links

References

  • "Rationale". Rich Hickey. clojure.org. Retrieved on 2008-10-17.

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net