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

RFC: add <- as an assignment-like operator #19765

Merged
merged 1 commit into from
Jan 5, 2017
Merged

Conversation

JeffBezanson
Copy link
Member

We currently don't parse this at all. This might be useful to define on objects that support some kind of insertion or assignment operation. One motivation is that I've seen <= used for that purpose.

This change parses <- with assignment-level precedence but as an ordinary function call.

@JeffBezanson JeffBezanson added parser Language parsing and surface syntax speculative Whether the change will be implemented is speculative labels Dec 29, 2016
@tkelman tkelman added the needs tests Unit tests are required for this change label Jan 4, 2017
@JeffBezanson JeffBezanson removed needs tests Unit tests are required for this change speculative Whether the change will be implemented is speculative labels Jan 4, 2017
@JeffBezanson JeffBezanson merged commit d4707a0 into master Jan 5, 2017
@tkelman tkelman deleted the jb/leftarrow branch January 5, 2017 17:02
@martinholters
Copy link
Member

We currently don't parse this at all.

Errr, well, before this, we had

julia> 0<-1
false

while now we have

julia> 0<-1

ERROR: UndefVarError: <- not defined

Is it worth reverting this and instead deprecating a<-b in favor of (the more readable, anyway) a < -b?

@JeffBezanson
Copy link
Member Author

Oops, you're quite right. That was a mistake. I knew there had to be some reason we didn't have that operator...

I'll revert this, then we can discuss whether to deprecate. Another option is to use <--, which does give a parse error in 0.5.

@tkelman
Copy link
Contributor

tkelman commented Jan 6, 2017

We need to have a test for the case that this broke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants