3 ms·
Consider: ((foo() || bar()) && baz() && (xyzzy || plop) && blah versus: (and (or (foo)
by kazinator 6y ago
Consider:
((foo() || bar())
&& baz() && (xyzzy ||
plop) &&
blah
versus:
(and (or (foo)
(bar))
(baz)
(or xyzzy
plop)
blah)
You're barking up completely the wrong tree here in your search for Lisp problems.
For Lisp, you have a simple algorithm with a few cases in it for indenting, which works equally well if you've broken every token out into a separate line, or just have a few line breaks.
There are no concerns like does this punctuator or operator "cuddle" into the previous line, or start the next line? Fewer aspects are a matter of taste, leading to better consistency from one project to the next.
Let's compare the coding style of the TXR Lisp standard library to randomly selected code written not only in completely different projects by different people, but in different dialects and languages:
TXR Lisp stdlib: http://www.kylheku.com/cgit/txr/tree/share/txr/stdlib/tagbody.tl http://www.kylheku.com/cgit/txr/tree/share/txr/stdlib/tagbod...
Clojure core: https://github.com/clojure/clojure/blob/master/src/clj/clojure/genclass.clj https://github.com/clojure/clojure/blob/master/src/clj/cloju...
GUIX internals (Scheme): https://git.savannah.gnu.org/cgit/guix.git/tree/guix/git.scm https://git.savannah.gnu.org/cgit/guix.git/tree/guix/git.scm
SBCL compiler code (Common Lisp): https://github.com/sbcl/sbcl/blob/master/src/compiler/dce.lisp https://github.com/sbcl/sbcl/blob/master/src/compiler/dce.li...
By golly, it all looks the same, formatting-wise, wherever I look!
I could throw any of that code into a stock installation of Vim with no plugins, and easily maintain its style with the built-in Lisp support. That Vim could be an old version from like 1999.