Why is Python popular, while Lisp and Scheme aren't?

Jacek Generowicz jacek.generowicz at cern.ch
Thu Nov 28 08:01:04 EST 2002


"Neil Hodgson" <nhodgson at bigpond.net.au> writes:

> Robin Munn:
> 
> > With color-highlighting, I could at least be certain *at a glance*
> > of which paren was lining up with which.

> Jacek Generowicz:
> 
> # I don't understand the distinction. The cursor is at some parenthesis;
> # the matching parenthesis is highlighted. I see it. It's immediate. I
> # can't imagine anything faster.
> 
>    You can see at a glance which parts match

I am somewhat skeptical about this. If you have nested parentheses,
the inner ones will break up the continuity of the colour of the outer
ones, and you will end up having to search for the _nearest_ matching
colour amid a sea of colour. Strikes me as much more difficult (and
error prone) than looking for the single clearly highlighted
parenthesis.

> without moving the caret around to highlight them one by one.

Remember that the issue was adding the correct number of parentheses
when closing the expression; you keep hitting ")" until the
parenthesis at the beginning of the expression you are wanting to
close lights up. With colours, you would have to type the parenthesis,
look at its colour, move your eyes over to find a matching colour,
decide it is not far enough, type another parenthesis, look at the
colour, forget the previous colour, search for the new colour
... sounds like a drag.

When your expression is already written the indentaiton provides
(IMHO) better visual clues than colours would.

> It looks worth pursuing to me, but I'm not motivated enough to
> implement it.

I agree with the latter because I disagree with the former :-)

One day, when I'm lost for something to do (that'll be the day!) I'd
like to pursue the s-expressions-by-indentation idea (actually, I
suspect that the reader has been hacked to implement this more than
once by now) to see whether it's any clearer, whether the code takes
up too much space (maybe some intermediate form which allows
parentheses when you need/want to cram more things on one line?)

Hmm ... it's not immediately clear to me how to distinguish between

  ... a) (b ...

and 

  ... a b ...


To take a specific example, both 

  (a (b (c d) e) (f))

and 

  (a (b (c d) e f))

would translate to

  a
    b
      c d
    e
    f

My translation scheme is "Keep going on the same line until you find a
parenthesis. Start a new line. If the parenthesis is "(" then increase
indentation, if it is ")" decrease indentation."

Strictly speaking, this would lead to a blank line between the "e" and
the "f" in the first case, but not in the second. However, making the
count of blank lines significant strikes me as horrible in the
extreme.

Hmm ... let's see whether Google finds any previous deliberations on
this matter ...



More information about the Python-list mailing list