Python syntax in Lisp and Scheme

Russell Wallace wallacethinmintr at eircom.net
Mon Oct 6 00:25:51 EDT 2003


(Note that I'm not usually in the habit of coming along to comp.lang.X
and posting criticism of X; I read this thread on comp.lang.lisp
without realizing a poster had set followups to this newsgroup only;
but I'll answer the questions below.)

On Sun, 05 Oct 2003 22:13:32 -0400, Hans Nowak <hans at zephyrfalcon.org>
wrote:

>Russell Wallace wrote:
>
>OK, I'll bite --
>
>> I'll claim C's syntax is objectively better - it has a clean
>> definition whereas Python's hasn't. 
>
>It hasn't?  What is unclean about it?

The relevant definitions in C:
A program is a stream of tokens, which may be separated by whitespace.
The sequence { (zero or more statements) } is a statement.

What's the equivalent for Python?

>Python uses indentation to indicate code blocks.  I don't really see what is 
>inconsistent about it.  Indentation doesn't matter inside list, dict and tuple 
>literals, but then again code blocks don't appear in those.

Except that 'if', 'while' etc lines are terminated with delimiters
rather than newline. Oh, and doesn't Python have the option to use \
or somesuch to continue a regular line?

>> if
>> it stuck to the decision to use whitespace it might be a bit less
>> repellent. Also Python's syntax has a whole category of pitfalls that
>> C's lacks.
>
>Like what?  If you mean inconsistent indentation, that one bites you just the 
>same in other languages, just in different ways.

But in ways that are objectively less severe because:

- If the indentation is buggered up, the brackets provide the
information you need to figure out what the indentation should have
been.

- The whole tabs vs spaces issue doesn't arise.

-- 
"Sore wa himitsu desu."
To reply by email, remove
the small snack from address.
http://www.esatclear.ie/~rwallace




More information about the Python-list mailing list