Settings

Theme

Why Clojure?

jeffchen.dev

3 points by jchen42 5 years ago · 1 comment

Reader

dreamcompiler 5 years ago

> Clojure provides some advantages over other Lisps like Common Lisp and Scheme: CL only includes lists in its core language spec. Clojure introduces vectors, sets, and maps which makes reading and writing code so much less tedious.

CL most assuredly includes vectors and hash tables in its core language spec (not to mention multidimensional arrays). And hash tables are one form of what Clojure calls a map. (The other forms exist in Common Lisp too; they're just called different things.)

http://www.lispworks.com/documentation/HyperSpec/Body/t_vect...

http://www.lispworks.com/documentation/HyperSpec/Body/18_.ht...

The author may be assuming that because CL does not use the '[]' and '{}' delimiters, CL doesn't implement the things that Clojure uses '[]' and '{}' for. If so, that assumption is wrong.

If the author finds that the use of '[]' and '{}' make code more readable, that's a matter of opinion. It would take about 6 total lines of code to teach CL to read '[]' and '{}' as a vector or a hash-table if one so desired. And yet over several decades of programming in Common Lisp, I have yet to see a program where a programmer did that. That tells me that working Common Lisp programmers have no difficulty with vectors or hash-tables absent special delimiters.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection