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

accept ∈ as a synonym for 'in' inside for loops and comprehensions #13824

Merged
merged 1 commit into from
Dec 8, 2015

Conversation

stevengj
Copy link
Member

As discussed in #8487, it's a bit odd and confusing that we allow x ∈ X as synonym for x in X comparisons, but we don't allow for x ∈ X as a synonym for for x in X.

This patch changes the parser to allow as a synonym for in in for loops and comprehensions.

(This should be backwards compatible: even existing code that works with ASTs is not affected, because both for x ∈ X and for x in X are parsed as for x = X.)

@stevengj stevengj added needs decision A decision on this change is needed parser Language parsing and surface syntax labels Oct 30, 2015
@mschauer
Copy link
Contributor

mschauer commented Nov 4, 2015

Thanks. I saw that you change the example in the docs from "in" to "∈", I would keep the "in" for the moment as it is at this moment trivially more widely used as "∈".

@stevengj
Copy link
Member Author

stevengj commented Nov 4, 2015

The docs have examples of both, as it should if both are supported. However, this PR is pending a conclusion to the discussion in #8487 of whether we want this syntax.

@JeffBezanson
Copy link
Member

Sure, why not. Let's rebase and merge this.

@stevengj
Copy link
Member Author

stevengj commented Dec 4, 2015

Rebased.

jakebolewski added a commit that referenced this pull request Dec 8, 2015
accept ∈ as a synonym for 'in' inside for loops and comprehensions
@jakebolewski jakebolewski merged commit 7a2534b into JuliaLang:master Dec 8, 2015
@stevengj stevengj deleted the forin branch December 8, 2015 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs decision A decision on this change is needed parser Language parsing and surface syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants