2 ms·
> in particular, your snippet of code has 3 different indentation strategies, and you hang your closing parens the way almost all Lisp programmers do. To me, it
by lispm 4y ago
> in particular, your snippet of code has 3 different indentation strategies, and you hang your closing parens the way almost all Lisp programmers do. To me, it all looks so organic and arbitrary.
In Lisp we don't align Lisp code according to only the parentheses.
A Lisp programmer looks at the symbol in front and based on that there are one or more strategies for indentation. On my Lisp Machine I can cycle through different indentations or I can completely layout the code (called 'grinding' in old Lisp).
There are different lists:
a definition macro
(defun name (arg1
arg2)
a
b)
a function call
(foo bar baz)
(foo bar
baz)
(foo
bar
baz)
a special form:
(if a
b
c)
(if a
b
c)
(when a
b
c)
Property lists:
(:name foo
:age 23)
and lots more. Each macro has a simple implementation style but typically an editor may have custom layout rules, depending on the macro and its syntax.