Looping on more than one list

Courageous jkraska1 at san.rr.com
Sun Jul 23 01:14:57 EDT 2000


> >(map nil #'(lambda (i j) ...) list-one list-two)
> 
> Right now, map(None, ...) will do what the proposed zip() function does,
> but zip() will be lazy, as is my understanding.

Well I haven't followed the zip discussions, but I do know
that lisp's map form, when confronted with more than one list,
will terminate mapping as soon as just one of the lists runs
out. For example:

USER(1): (map 'list #'(lambda (i j) (+ i j)) '(1 2 3 4) '(0 1 2))
(1 3 5)


C/



More information about the Python-list mailing list