Smalltak [RE: Whitespace as syntax (was Re: Python Rocks!)]

Tim Peters tim_one at email.msn.com
Mon Feb 14 22:22:12 EST 2000


[Tim]
> Python's tuple notation was inherited from ABC.  Python generalized it
> somewhat, but didn't fiddle.

[/F]
> otoh, the ABC quick reference at
> http://www.cwi.nl/~steven/abc/qr.html
> uses:
>
>     {1; 2; 3}

That's an ABC list, though.  Guido didn't adopt ABC's notation for lists,
and I'm glad -- I never liked the semicolons *or* the curlies there.  I take
it on faith that this notation survived user testing, from which I can only
conclude that the users that day were a bunch of dope-smoking Dutch <wink>.

Python's tuples were called "compounds" in ABC, and used the familiar comma
notation.

Python's

   a, b = 1, 2

really wouldn't work as

   a; b = 1; 2

(indeed, that means something entirely different in Python today).  In ABC
that was spelled

    PUT 1, 2 IN a, b

There was no indexing of compounds; the only way to break one apart was via
multiple-target binding, with exactly as many targets as the compound had
"fields".

Curious:  The quote above used

   {1; 2; 3}

as an example, and that's not a 1-in-6 accident <wink>.  In ABC, that's
exactly the same as the list

   {3; 2; 1}

and the ones corresponding to the other four permutations of the elements.
ABC lists "auto-sorted", whether you wanted them to or not.  This is one of
the ways in which ABC's uncompromising friendliness to raw newbies drove
experienced programmers nuts.

python-could-have-turned-out-a-lot-stranger<wink>-ly y'rs  - tim






More information about the Python-list mailing list