Python syntax in Lisp and Scheme

Doug Tolton doug at nospam.com
Thu Oct 9 02:07:42 EDT 2003


Michael Geary wrote:
> Andrew Dalke:
> 
>>The phrase "they had hard-headed engineering reasons for
>>making the syntax look so strange." reminds me of the statement
>>"better first rate salespeople and second rate engineers than
>>second rate salespeople and first rate engineers" (and better
>>first rate both).  That's saying *nothing* about the languages;
>>it's saying that his viewpoint seems to exclude the idea that
>>there are hard-headed non-engineering reasons for doing things."
>>
>>Consider one of those "hard-headed engineering reasons", at
>>http://www.paulgraham.com/popular.html
>>
>>   It has sometimes been said that Lisp should use first and
>>   rest instead of car and cdr, because it would make programs
>>   easier to read. Maybe for the first couple hours. But a hacker
>>   can learn quickly enough that car means the first element
>>   of a list and cdr means the rest. Using first and rest means
>>   50% more typing. And they are also different lengths, meaning
>>   that the arguments won't line up when they're called,
>>
>>That to me is a solid case of post hoc ergo proper.  The
>>words "1st" and "rst" are equally as short and easier to
>>memorize.  And if terseness were very important, then
>>what about using "." for car and ">" for cdr?  No, the reason
>>is that that's the way it started and it will stay that way
>>because of network effects -- is that a solid engineering
>>reason?  Well, it depends, but my guess is that he wouldn't
>>weight strongly the impact of social behaviours as part of
>>good engineering.  I do.
> 
> 
> It's pretty funny when you consider that car and cdr were named after the
> Contents of Address Register and Contents of Decrement Register on the IBM
> 704. Now that's a solid engineering reason!
> 
> (I'm not knocking Lisp; in fact, this discussion has whetted my appetite to
> explore it.)
> 
> -Mike
> 
> 
Graham does admit in that the reasons for the choice were mostly 
historical.  However, he uses them because he likes the fact that they 
are shorter than first and rest.

If you read his design goals for Arc you will note that he is a big fan 
of very terse operators.



-- 
Doug Tolton
(format t "~a@~a~a.~a" "dtolton" "ya" "hoo" "com")





More information about the Python-list mailing list