Why is Python popular, while Lisp and Scheme aren't?
Alexander Schmolck
a.schmolck at gmx.net
Sun Nov 24 19:50:19 EST 2002
Patrick W <patrickw106 at yahoo.com.au> writes:
> Martti Halminen <martti.halminen at kolumbus.fi> writes:
>
> > Alexander Schmolck wrote:
> >
> > > for item in container: ; no convienient idiom (?)
> > > print item
> >
[...]
> And for acting upon each item within a container, the usual idiom is
> (mapcar #'function list) or (map 'output-type #'function sequence).
> The various mapping functions in Lisp remove a lot of the need for
> explicit loops (similar to the way in which list comprehensions
> replace many loops in modern Python).
While functional programming constructs like map replace the need for loops in
many cases, they don't replace the need for a generalized iteration protocol
(in python you can ``map`` or ``filter`` over any container).
alex
More information about the Python-list
mailing list