Re:Functional programming explained in Clojure with a termin...
by brudgers on Friday May 16, 2014 @09:56AM
(#7755493)
Yes, and no. Viewed as a Lisp, it trades some simplicity for practicality, e.g. vectors rather than lists as the container for arguments to a function. Neither than `lambda` template for Common Lisp's `defun` macro or the "usage" template for Scheme's `define` are consistent with the overall language syntax because the list should be quoted or executed.
On the other hand, viewed as a DSL for the JVM implemented as a Java library or as an evolutionary step in Lisp, Clojure's syntax makes a lot more sense.
Summing over a collection is a one liner in Clojure (as in many other languages):
=> (reduce + (range 10))
45
Clojure's dynamic typing trades simplicity of syntax for the static typing safety harness required in ML or Haskell.
On the other hand, viewed as a DSL for the JVM implemented as a Java library or as an evolutionary step in Lisp, Clojure's syntax makes a lot more sense.
Summing over a collection is a one liner in Clojure (as in many other languages):
Clojure's dynamic typing trades simplicity of syntax for the static typing safety harness required in ML or Haskell.