Skip to content

Proposal: Allow Single Dollar Sign as Valid Identifier #354

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

Merged
merged 1 commit into from
Oct 14, 2016

Conversation

ankurp
Copy link
Contributor

@ankurp ankurp commented Jun 4, 2016

Swift should continue supporting use of $ as an identifier but when used with non-numeric name consider it an error.

→ View Proposal

@ankurp
Copy link
Contributor Author

ankurp commented Jun 20, 2016

Any comments on this proposal?

@lattner
Copy link
Collaborator

lattner commented Jun 23, 2016

This proposal looks in scope for Swift 3 for discussion, but I think it would be helpful if you improved the writing to make it more clear: I think what you're trying to say is that "$[0-9]+" is reserved for closure parameters, that $ by itself should be a valid identifier, and that "$[a-zA-Z_....]" (where the second character is something that would start a valid identifier) should be invalid.

@ankurp
Copy link
Contributor Author

ankurp commented Jun 24, 2016

@lattner as you said. Rewording to make it clear.

@dabrahams dabrahams changed the title Proposal: Allow Single Dollar Sign as Valid Identified Proposal: Allow Single Dollar Sign as Valid Identifier Jul 7, 2016
@masters3d
Copy link
Contributor

swiftlang/swift#3901

@masters3d
Copy link
Contributor

@lattner with PR https://github.com/apple/swift/pull/3901/files already merged. This can be closed.

@ankurp
Copy link
Contributor Author

ankurp commented Sep 12, 2016

I had suggested keeping the Dollar as valid identifier. If my PR is to be closed then it should have been done in June when I requested it and not wait until now by keeping it open. I created this PR in June then someone comes in August and merge their code that changes language syntax breaking a lot of existing code by doing opposite of what I suggested.

@lattner
Copy link
Collaborator

lattner commented Oct 12, 2016

Hi @ankurp,

The core team discussed this today and would like to run this proposal for review by the swift-evolution community. Three requests:

  1. please update it to the new proposal template: https://github.com/apple/swift-evolution/blob/master/0000-template.md
  2. please do an editing pass to improve typos and the writing, for example there is a typo in the title.
  3. Please mention that $ was never documented in the TSPL book.

Thanks!

@ankurp
Copy link
Contributor Author

ankurp commented Oct 12, 2016

Thanks will update soon.

@lattner
Copy link
Collaborator

lattner commented Oct 12, 2016

@ankurp ankurp force-pushed the dollar branch 2 times, most recently from bf757e8 to 8aa5803 Compare October 13, 2016 14:43
@ankurp
Copy link
Contributor Author

ankurp commented Oct 13, 2016

Updated the proposal to be more clear. Looking forward to whatever the community decides.

@lattner
Copy link
Collaborator

lattner commented Oct 14, 2016

Thanks! I'll merge this, make a few tweaks, and kick off review.

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

Successfully merging this pull request may close these issues.

3 participants