Is Clojure considered Lispy or Schemey? [duplicate]
Possible Duplicate:
Is Clojure closer to Scheme or Common Lisp from a beginner's perspective?
Clojure is a Lisp dialect that runs on the JVM.
Is Clojure considered Lispy or Schemey? I mean is it like Lisp or like Scheme?If by "Lispy" you mean "like Common Lisp," then...
Clojure is "Lispy" because it has full (nonhygienic) macros and doesn't guarantee tail-call optimization (except with recur
).
Clojure is "Schemey" because it has a single namespace for both functions and values (it is a Lisp-1).
Lisp has mainly two meanings:
- Lisp is a family of programming language, starting with the original Lisp in 1958.
In this sense Scheme, Clojure, Emacs Lisp, Common Lisp, Logo, ... are all somewhat 'Lispy'.
- Lisp is a family of language with one main branch: Lisp, Lisp 1.5, MacLisp, Lisp Machine Lisp, Common Lisp.
One can see that it is possible to run decades old Lisp code with very few changes in Common Lisp.
In this view, neither Scheme nor Clojure are particular 'Lispy', since they are widely incompatible with the 'main branch' and with the historic Lisp.
Clojure is a new Lisp dialect that is mostly incompatible with all other Lisps and also with the historic Lisp. Names of functionality, identifiers, syntax, etc. are all different. In my view it is as far from CL as it is from Scheme.
When people say "Schemey" they tend to mean "Lisp-1" vs. "Lisp-2", which is historically the distinction. Clojure is schemey in that fashion.
But beyond those, Clojure is stylistically more like very modern lisp sensibilities. Probably the most notable predecessor to clojure in this modern style is Arc. If anything, Clojure is arc-ish: it prefers constructs with reduced nesting depth (see clojure and arc let vs. common lisp or scheme let); both are distinct runtimes nested within larger, more generic interpreter runtimes that give a larger library for free; and both value brevity in names as opposed to the insanely long names in the common lisp spec (e.g., multiple-value-bind).
Clojure is arc-ish.
精彩评论