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

Add helpful message for arity mismatch on function call #1824

Open
1 task done
dann-merlin opened this issue Jul 7, 2024 · 0 comments
Open
1 task done

Add helpful message for arity mismatch on function call #1824

dann-merlin opened this issue Jul 7, 2024 · 0 comments

Comments

@dann-merlin
Copy link
Contributor

What new feature should Elvish have?

When calling a function with an incorrect number of arguments, it would be nice if alongside the exception a helpful message about the function signature, or maybe even the documentation of the function, is displayed.

Example:

~/Programming/elvish> assoc
Exception: arity mismatch: arguments must be 3 values, but is 0 values
  [tty 7]:1:1-5: assoc

could be something like:

~/Programming/elvish> assoc
Exception: arity mismatch: arguments must be 3 values, but is 0 values
expected usage: assoc <container> <k> <v>
  [tty 7]:1:1-5: assoc

Output of "elvish -version"

0.21.0-dev.0.20240628122205-536f2c18dca2

Code of Conduct

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

No branches or pull requests

1 participant