News for hackers. Stuff that matters.
Re:Swift and the Legacy of Functional Programming by jstimpfle on Monday November 21, 2016 @02:43PM (#13008482)
This is the one case where python's list comprehension syntax isn't so efficient. Don't worry about it - be consistent and use it nevertheless. It doesn't matter much.

In the cases where x gets also transformed or you do some unpacking the syntax is very efficient and easy to read: [f(y) for x, y in items if g(x)]. Basically it's a poor man's relations programming (think databases). It's brilliant. (And definitely easier to read and write than the Haskell list comprehension syntax).

There are no comments on this comment yet.