Clojure is a functional language.
Functional language is not the mainstream of today's development language.
Most mainstream is the "imperative" language (imperative language)
Among them, the object-oriented paradigm is mostly.
On the trend of development, parallel, distributed, multi-CPU is becoming more and more popular.
Mainstream language in the treatment of these changes is inefficient, a little powerless.
Therefore, in recent years, functional language has the meaning of a comeback.
A functional or functional language, the oldest Lisp series,
The scholarly Haskell, the OCaml of the ML family.
A vain attempt to replace Java's Scala
And, of course, the clojure of simplicity and pragmatism.
Clojure is very simple, the whole language is a Clojure-xxxx.jar file, the development of nearly 10 years, still only about 3M.
The common features of the functional formula are:
Advocating "pure function", that is, no side effects, on the specific input, will always be the same output.
"Function" is a class citizen. Can be passed as a parameter as a variable of type int string, as a return value,
It can also be said that high-order function features are supported.
Use immutable "data" instead of "variables"
This benefits a lot and can easily handle concurrency without the "lock" puzzle
The focus is on "transformations" and "combinations of transformations", which are concerned with "verbs" rather than "nouns" in object-oriented kingdoms-that is, objects. It's called "The Revenge of the verb."
Clojure is very pragmatic, not to swim in the math world, but chose the JVM as the host.
You can manipulate classes, objects, and methods in the Java class Library as easily as you would call your own function.
Java can do a very good thing, Clojure no longer re-invent, at most is packaging, in order to better combination.
Clojure emphasizes "invariance", but does not refuse to use "variable" occasionally
Clojure emphasizes "pure function", but does not reject necessary "side effects" (such as debug printing)
Clojure advocates "lazy evaluation", but does not compel you to do so.
Finally, Clojure is a Lisp dialect, a Lisp dialect on the JVM.
It retains the power of Lisp and is more concise
Even if it is never used, its design philosophy, inner philosophy is definitely worth the taste!
Learning to use Clojure (1)