Format it as you like. The task of the editor is to display the code in any style that the reader prefers. I like the hierarchical tree-like format of C-style with single brackets on their own lines (all LISPers are boiling with rage at the same time :-)))))))))))))
But I sometimes use this style:
(fn rep ([lst n] (rep (rest lst) n (take n (repeat (first lst)) ) ) ) )
which is an update to the traditional style in which the brackets are spaced (log2 level)
The reason I like space is because my eyesight is poor and I just can't read thick text. So, to the angry LISPers who are going to tell me that I am doing what the traditional way, I say, well, everyone has their own way, relaxation, everything is in order.
I can’t wait for someone to write a decent editor in Clojure, although this is not a text editor, but an expression editor **, then the formatting problem disappears. I write myself, but it takes time. The idea is to edit expressions by applying functions to them, and I move the code using zipper, expression by expression, and not by words or characters or lines. The code is represented by any display function you want.
** Yes, I know emacs / paredit, but I tried emacs and I didn’t like regret.
Hendekagon
source share