tree functions daily exercise: Table

xah at xahlee.org xah at xahlee.org
Fri Jun 24 03:04:29 EDT 2005


Dear Dr Jon D Harrop,

“List Comprehension” is a special concise syntax form that
generates lists, as a way to save typing such as for loops. It is
primarily a jargon bandied about by programers which have contributed
huge misunderstandings and miscommunications. The extensiveness of this
particular jargon's harm has also encroached into functional programing
languages as to cause irregular syntax and less powerful semantics. The
utility of “list comprehension” is just a (normal) function
designed to generate list.

References:
• A exposition of list comprehension in Python.
http://xahlee.org/perl-python/list_comprehension.html

• Jargons of Info Tech Industry
http://xahlee.org/UnixResource_dir/writ/jargons.html

 Xah
 xah at xahlee.orghttp://xahlee.org/

Jon Harrop wrote:
> David Hopwood wrote:
> > That's consistent with the behaviour of list comprehensions in other
> > languages -- including "set/tuple formers" in SETL
> > <http://www.cs.nyu.edu/~bacon/setl-doc.html>, which I believe was the
> > first language to support them. I don't know of any language where
> > a list comprehension with multiple loops creates nested lists.
>
> I'm not entirely sure what a list comprehension is, but Mathematica might be
> an example of a language in which multiple loops create nested lists.
>
> --
> Dr Jon D Harrop, Flying Frog Consultancy
> http://www.ffconsultancy.com




More information about the Python-list mailing list