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

:: is sometimes a variable name #18561

Closed
nbaum opened this issue Sep 17, 2016 · 3 comments
Closed

:: is sometimes a variable name #18561

nbaum opened this issue Sep 17, 2016 · 3 comments
Labels
parser Language parsing and surface syntax

Comments

@nbaum
Copy link
Contributor

nbaum commented Sep 17, 2016

:: behaves like an identifier except it can't be assigned to.

f(::) = :: works and defines the identity function.

f(::Any) = :: works, but raises UndefVarError when called.

:: = 42 is invalid syntax. (Unexpected "=".)

I think that :: should be semantically equivalent to ::Any although possibly not parsed the same: macros might find the difference useful.

@simonster
Copy link
Member

simonster commented Sep 17, 2016

(::)(::) = (::)(::)
(::)((::)::typeof(::)) = ::
((::)(::)(::)::typeof(::))(Type){((::)(::)(::)::typeof(::))(typeof(typeof(::)))(typeof((::)(::)))}

@nbaum
Copy link
Contributor Author

nbaum commented Sep 17, 2016

Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should.

@JeffBezanson JeffBezanson added the parser Language parsing and surface syntax label Sep 17, 2016
@fredrikekre
Copy link
Member

same as #18912 and fixed by #22947

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

No branches or pull requests

4 participants