merits of Lisp vs Python

greg greg at cosc.canterbury.ac.nz
Fri Dec 15 06:18:26 EST 2006


josephoswaldgg at hotmail.com wrote:
> Neil Cerutti wrote:
> 
>>On 2006-12-13, josephoswaldgg at hotmail.com
>><josephoswald at gmail.com> wrote:
>>
>>>Expressions keep the same meaning even if you have to start
>>>breaking them across lines, etc.
>>
>>Yes, it's the same way in Python. Of course, not everything is an
>>expression in Python, so it's not saying quite as much.
> 
> I fail to see how it is the same in Python.

Probably what Neil is referring to is the fact that in
Python, *within an expression*, indentation is not relevant.
If you put parens around the whole expression, you can split
it across lines however you like, and indent all the lines
after the first one however you like, and it makes no
difference. You could probably even use your Lisp-aware
auto-indenter on the expression and it would do something
reasonable.

It's only *statement* nesting that's determined by relative
horizontal position (which is a better way of thinking about
it than "whitespace" -- the whitespace is only there to
get things into the right position). And statements normally
occupy one or more entire lines.

> How does a manual correction process come out as simple as "don't
> bother fixing the indentation if you don't care."?

I think the point is that correcting indentation in Python
is the equivalent of fixing misplaced parentheses in Lisp,
and that they're about equally difficult.

--
Greg



More information about the Python-list mailing list