Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When trained to read Lisp, the human reader concentrates on indentation, code shape and the leading symbols. The leading symbols determine the syntax of the expression.

LAMBDA = lambda (args) body

LET = let (bindings) body

binding = (var [value]) | var

actually the syntax is quite a bit more complex, since args have a lot of options and both LET & LAMBDA allow type declarations.

Each of the symbols also determine a certain indentation style and code shape. There are built-in operators, macro operators and function calls. Especially macros provide an unbound amount of syntactic possibilities.

Trying to figure out expressions by looking at parentheses and finding pairs by parenthesis alignment is mostly not used. It's a too complex visual operation.



It's not too complex IF you align the parenthesis.

The only reason I can see to put multiple closing parenthesis on the same line is to save vertical space. But if you pack too much code in a few lines, readability suffers.

To get the semantics of your statements right you do need to know where syntactic units start and end.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: