-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
error messagesBetter, more actionable error messagesBetter, more actionable error messagesparserLanguage parsing and surface syntaxLanguage parsing and surface syntax
Description
In Julia 1.10-rc1:
julia> f(x, y, z) = x+y+z
f (generic function with 1 method)
julia> f(3,4 5)
ERROR: ParseError:
# Error @ REPL[2]:1:7
f(3,4 5)
# ╙ ── Expected `)`
Stacktrace:
[1] top-level scope
@ none:1
Contrast this with Python 3.10 which instead:
>>> def f(x,y,z): return x+y+z
...
>>> f(3,4 5)
File "<stdin>", line 1
f(3,4 5)
^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
The error message of Python seems better, can we change the Julia message to something similar? Probably multiple dispatch makes this trickier though.
Indeed it was better in Julia 1.9
julia> f(3,4 5)
ERROR: syntax: missing comma or ) in argument list
Stacktrace:
[1] top-level scope
@ none:1
Metadata
Metadata
Assignees
Labels
error messagesBetter, more actionable error messagesBetter, more actionable error messagesparserLanguage parsing and surface syntaxLanguage parsing and surface syntax