News for hackers. Stuff that matters.
Re:Kotlin for Data Analysis by wenc on Wednesday August 28, 2024 @11:22PM (#41386960)
Python's list comprehensions are close to set notation in math. Here's Python:

    [2*x for x in range(n + 1) if x <= 100]
Here's set notation:

    {2*x | x in 0..n, x <= 100}
So it reads pretty easily for those of us used to set notation. Haskell is even more similar to set notation:

    [2*x | x <- [0..n], x <= 100]

There are no comments on this comment yet.