### list comprehension, python, semantics ＆ syntax, and the hacker idiocies

Guido wants to remove {lambda, map, reduce} in python. He wants us to use list comprehension exclusively. see Lambda in Python 3000.

if you don't know what list comprehension is, see Python Tutorial: List Comprehension

list comprehension is no good. see Computer Language Design: What's List Comprehension and Why is It Harmful?

still, the python hacker idts defend it by “its faster”. In which, python compiler idcy comes forward to defend python language idcy, like a snake eating its tail.

however, there's one important semantic advantage of list comprehension. That is, using expressions to build complicated list. The advantage is seen especially with multiple variables (⁖ nested array n levels deep, each level has different number of nodes.). This would be nested map, which is cumbersome. This is also why, Mathematica has the Table[] construct http://reference.wolfram.com/language/ref/Table.html, which is a functional form of list comprehension. (in Common Lisp, the analogous is its `loop`

. However, only Mathematica's syntax is functional. Python and Common Lisp loop syntax are imperative warts on drugs.)

by the way, idts will start to talk about list comprehension as analogous to math's set comprehension and stuff. U no unstand.

math's set comprehension notation is a idiocy, first of all. see:

- The Problems of Traditional Math Notation
- 〔Functional mathematics By Raymond Boute. @ http://www.funmath.be/〕
- Abuse of notation
- 〔How Computing Science created a new mathematical style By Edsger W Dijkstra. @ http://www.cs.utexas.edu/users/EWD/transcriptions/EWD10xx/EWD1073.html〕
- 〔Computational Knowledge and the Future of Pure Mathematics By Stephen Wolfram. @ http://blog.stephenwolfram.com/2014/08/computational-knowledge-and-the-future-of-pure-mathematics/〕

or Google search for “calculational proof” by Dijkstra or others, or “calculational math”.

secondly, programing language's list comprehension has nothing to do with math's set notation, unless you are talking about purely declarative functional languages or proof system language that actually have some form of “comprehension”, such as coq or HOL, see:

by the way also, “list comprehension” is one of those fuzzy thing. Any lang that has a weird loop syntax can claim to have “list comprehension”. So, on pages such as Wikipedia, you have one hundred languages all trying to demo its list comprehension. Like, “regardless how idtc i am, also ran is my very advanced feature the list comprehension, witness.”.

- Concepts ＆ Confusions of {Prefix, Infix, Postfix, Fully Nested} Notations
- Unix Pipe as Functional Language
- What's Function, What's Operator?
- JavaScript Syntax Soup: 「p in o」 vs 「for (p in o) {…}」
- Python's Context Dependent Syntax Soup: 「… in …」 And 「… not in …」
- Programing Language: LISP Syntax Problem of Piping Functions