Python syntax in Lisp and Scheme

Kenny Tilton ktilton at nyc.rr.com
Tue Oct 7 15:42:03 EDT 2003


Hannu Kankaanp?? wrote:

> The problem with the example arises from the fact that indentation
> is used for human readability, but parens are used by the parser.

And by the editor, meaning the buggy code with the extra parens had not 
been written in a parens-aware editor (or the coder had stuck a parens 
on without kicking off a re-indentation).

> A clash between these two representations can lead to subtle bugs
> like this one. But remove one of the representations, and there
> can't be clashes.

No need. Better yet, with parens you do not have to do the indentation 
yourself, you just have to look at what you are typing. Matching parens 
highlight automatically as you close up nested forms (it's kinda fun 
actually), and then a single key chard re-indents (if you have been 
refactoring and things now belong at diff indentation levels).

I used to spend a /lot/ of time on indentation (in other languages). No 
more. That is just one of the advantages of all those parentheses.

kenny





More information about the Python-list mailing list