|
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.
PhilosophyRich Hickey developed Clojure because he wanted a Lisp for functional programming, symbiotic with an established platform, designed for concurrency. SyntaxLike 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. MacrosClojure'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 linksReferences
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net