Python syntax in Lisp and Scheme
Terry Reedy
tjreedy at udel.edu
Wed Oct 15 10:10:15 EDT 2003
<prunesquallor at comcast.net> wrote in message
news:he2b7wum.fsf at comcast.net...
> "Terry Reedy" <tjreedy at udel.edu> writes:
> >> prunesquallor at comcast.net writes:
> >> > Since having the correct amount of whitespace is *vital* to the
> > "Pascal Bourguignon" <spam at thalassa.informatimago.com> wrote in
> >> That remembers me that when the languages had significant
spaces,
> >> programming was done with forms, sheets of physical paper
> > I do believe that several Lispers have suggested that people
should
> > give Lisp a fair trial before rejecting it on account of
parentheses
> > or macros. The same goes, of course, for Python and significant
> > indents/dedents. For most people who try Python, freedom from
> > visually redundant fences is a feature. Those who find it a
bother
> > after trying are welcome to chose another language.
> >
> > What makes the comments above doubly absurd is that Lisp has as
much
> > or more need for 'significant spaces' as Python.
> That is simply incorrect. It is a small matter to set the readtable
> such that things like (+x3) are interpreted as (+ x 3). This would
> make it much more difficult to use complicated variable names, but
> that's the tradeoff.
So I revise my statement: unless one uses a Lisp with a 'nospace'
option present and turned on, Lisp ...
But why be defensive and nitpicky? I consider this whitespace use (in
the usual case) to be a feature of Lisp. It works well for Lisp
because subexpressions are sublists delimited by (). By contrast,
eliminating commas for Python sequences would be awkward since tuples
are currently *defined* by the present of commas.
> > Compare (1,2,3) versus (1 2 3). Having the "correct amount of
> > whitespace is *vital* to the correct operation of a" Lisp program
as
> > much as for any other. Do Lispers therefore use forms? I suspect
> > not ;-)
>
> There's a bit of a difference between the whitespace separating
tokens
> and the whitespace that delineates blocks.
We agree; this was one point of my posting. If you are going to slam
Python for its block-delimiting whitespace feature, with or without
having tried it, I would prefer that you say so specificly instead of
using sloppy generalizations like 'whitespace' or 'significance
spaces' that apply to most languages ;-)
As for the programming-form gag, if I were to write substantial
amounts of Python by hand (as I once did with Fortran), I should like
having lined paper with unobtrusive indent ticks every centimeter or
half inch.
Terry J. Reedy
More information about the Python-list
mailing list