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

Incorrect function syntax could have more friendly error message #436

Open
frankier opened this issue Aug 27, 2016 · 1 comment
Open

Incorrect function syntax could have more friendly error message #436

frankier opened this issue Aug 27, 2016 · 1 comment

Comments

@frankier
Copy link

I believe a common mistake for people coming with some programming experience in other languages might be trying to call a function with positional arguments. So eg if I call call a function like so sgn_x = new_x / abs[new_x] I will get an error like:

Unknown expression
(passed string)
Unknown expression "abs"

54|  sgn_x = new_x / abs[new_x]
                    ^
Did you mean: "abs"?

I think in this particular case the error should instead mention the parameter needs to be given a name and possible offer a fixit at least for single parameter built-ins where the intention should be easily guessable.

@joshuafcole
Copy link
Contributor

Agreed! We have all the information required, but not a lot of love has been put into the errors yet. I'll make sure this happens before the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants