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

2√2 does not work #40094

Closed
knuesel opened this issue Mar 18, 2021 · 1 comment · Fixed by #40173
Closed

2√2 does not work #40094

knuesel opened this issue Mar 18, 2021 · 1 comment · Fixed by #40173
Labels
parser Language parsing and surface syntax

Comments

@knuesel
Copy link
Member

knuesel commented Mar 18, 2021

Surprised to find the following doesn't work:

julia> 22
ERROR: syntax: extra token "" after end of expression

(while 2sqrt(2) does).

@knuesel knuesel changed the title 2√x 2√2 does not work Mar 18, 2021
@JeffBezanson JeffBezanson added the parser Language parsing and surface syntax label Mar 18, 2021
@ehgus
Copy link

ehgus commented Mar 21, 2021

I have futher tested in julia 1.5.4 (and very recent version from git repository).

redefining "√" to "f"

julia> f(x) = x
f (generic function with 1 method)
julia> 2f(2)
2.82842712474619032

adding parenthesis to "√" call

julia> (2)
1.4142135623730951
julia> 2(2)
ERROR: syntax: extra token "" after end of expression
Stacktrace:
 [1] top-level scope at none:1

I think parser do not treat "√" as normal function and that's the problem

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 a pull request may close this issue.

3 participants