Usually code looks like this:
(one-thing
(another-thing arg1 (f arg5 r))
(another-thing arg1 (f arg5 r)))
Why doesn’t it like this?:
(one-thing
(another-thing arg1 (f arg5 r))
(another-thing arg1 (f arg5 r))
)
It allows adding and removing “another-thing” lines more easily (without removing and re-adding trailing closing parenthesis). Also you can put a some comment on that lone closing parenthesis (such as “; end of the loop”).
How bad is it when I mix by code that uses the second style with existing code that uses the first style?
There are two points to be made here:
Conventions are important in themselves. Sticking to wrapped parens means your code is more readable by other lisp programmers, and if you adopt this style you will also develop practice at reading theirs
The advantages of splitting
)s onto their own lines are not actually advantages in the eyes of most lispers. If you are using a half-decent editor it will have commands that understand balanced expressions, for moving across them, cutting, pasting, transposing, etc. So you don’t needin lisp any more than you need
in some whitespace-sensitive language like Python
See e.g. http://www.gnu.org/software/emacs/manual/html_node/emacs/Expressions.html