Why aren't we all speaking LISP now?
jkraska1 at san.rr.com
Sat May 12 14:07:27 EDT 2001
>> Even simple things like iterating over a sequence of objects is done
>> in a completely different way: in Lisp you do something to the first
>> item then recurse. In Python, you use "for x in list".
I missed this comment earlier. It's incorrect. Amongst professional
Common Lisp programmers, there are two common forms used for
iterating over items in a list. They are (dolist), which is identical in
function to Python's for: form, and (map) which is identical in function
to Python's map/lambda (which was borrowed directly from Lisp)
and very similar in function to Python's list comprehension.
(dolist) is used to iterate over a list, (map) is often used to transmogrify
one sequence into another, although isn't limited to this (i.e., map can
do what dolist does, albeit a bit less efficiently, I think).
thinks-whoever-wrote-that-comment-doesn't-know-much-about-lisp ly-yrs C
More information about the Python-list