Why is it customary to put many closing parentheses on one line in Lisp-based languages?

后端 未结 8 1200
野的像风
野的像风 2021-02-05 01:19

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?:

8条回答
  •  春和景丽
    2021-02-05 01:58

    I think a good answer to this is ask a related question:

    why don't Python programmers put the glyphs that close nesting on their own lines?

    And the answer now is obvious: there are no such glyphs. And it turns out that there are no such glyphs in Lisp either: yes, there are these mildly annoying ( and ) characters that the Lisp reader needs, but human beings do not read Lisp code like this: they read it by indentation and words.

提交回复
热议问题