-
Notifications
You must be signed in to change notification settings - Fork 14
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
Inconsistent error messages #19
Comments
A couple more: library(zeallot)
{x} %<-% list()
{x : y} %<-% list()
#> Error: cannot de-structure list I also think it would be useful to include |
You are absolutely right that the error messages need to incorporate In general, the error messages were modeled after Python's error messages. Your first example translated over to Python produces the message below. #>>> [x] = [1, 2]
#Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
#ValueError: too many values to unpack I built the Similarly, because the LHS is assumed to be correct, when the RHS contains too few values, an error is raised pointing the blame at the RHS. {x : y : z : a } %<-% list(1, 2)
#> Error: expecting 4 values, but found 2 The LHS expected 4 values, but the RHS only provided 2. An error message along that line might be better suited. |
I think all these errors are related to a mismatch between the number of elements on the LHS and RHS, and so should use the same text. I don't think there's a need to mimic python's inconsistencies. |
That's fair, always striving to be better. The hope was the different messages help the user identify different problems, but if the messages are counter intuitive then they're self-defeating. |
The text was updated successfully, but these errors were encountered: