Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter syntax for comprehensions #835

Closed
mlubin opened this issue May 14, 2012 · 2 comments
Closed

Filter syntax for comprehensions #835

mlubin opened this issue May 14, 2012 · 2 comments

Comments

@mlubin
Copy link
Member

mlubin commented May 14, 2012

It would be convenient in many cases to be able to add a filtering condition to comprehensions, something like:
[ f(x) for x in 1:n if somecondition(x)]

where the resulting array only contains those x where somecondition(x) == true. This mirrors python's syntax.

@tautologico
Copy link
Contributor

Haskell, Scala and F# also include syntax for filtering in comprehensions. I believe most languages that have comprehensions support filtering.

@JeffBezanson
Copy link
Member

Duplicate of #550.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants