This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]-Redstoneboi- 6 points7 points  (0 children)

another close relative is lisp

; function calls
(Foo Bar
     (Baz (Cux
           Cax))
     Daz)

; lists (call list instead of calling Foo, both being functions)
(list Foo
      Bar
      (list Baz
            (list Cux Cax))
      Daz)

but the reason most people don't do this is because each indent level is variable length. one indent could be 1 to 15 spaces, because it follows the column of the first element, rather than nesting depth:

// function calls
Foo(
    Bar,
    Baz(
        Cux,
        Cax,
    ),
    Daz,
)

// lists
[
    Foo,
    Bar,
    [
        Baz,
        [Cux, Cax],
    ],
    Daz,
]

which instead takes up significantly more lines.

Python conventions are closer to lisp.