Search code examples
syntaxclojuresyntactic-sugar

Is there any program to add brackets of Clojure?


When I'm learning Clojure of some languages, the readability and convenience of syntax is the most important issue(Maybe this's wrong..).
So, Clojure is greatly appealing me, but there might be to many brackets to maintain.
And I'm considering if there's a script with which I can write code without some brackets and then compile it to Clojure, that should be better. Does such programe exists so far?
(Once told there is a indentation syntax for Scheme, that's nice. How about Clojure?)


Solution

  • Usually you use an editor or IDE that will take care of the brackets for you.

    It is especially useful to have "rainbow parens", i.e. the parentheses are given different colours to match their nesting level so you can quickly see how they line up.

    Some options:

    • The Counterclockwise plugin for Eclipse - great if you are already an Eclipse user of if you want to mix Clojure and Java code.
    • Emacs - a common choice for Lisp programmers. There is a pretty good set of Clojure tools for Emacs

    Note that in general, because of it's conciseness, Clojure code uses fewer parentheses than the equivalent Java code.