-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fallback to implicit multiplication when function call fails? #575
Comments
This also makes the order of precedence confusing as the implicit multiplication should have higher precedence than the explicit one, but with parentheses, the explicit multiplication is required. |
I could see a few avenues here:
Also for interpreting constraint error messages:
This means numbat tried to do type unification to treat |
In general, I agree. I also find myself running into that error.
The interpretation is correct (and
We can think about it. But I'm generally rather opposed to things like this. I like languages with clear and concise syntax rules, without too much "magic" or "guesswork". I we can rule out that this has unwanted side-effects, we can think about it.
Please, no. I don't want the language to have significant whitespace of this kind. |
Yeah, I definitely see the conundrum here. I would argue that this one is particularly important, since probably many more users are using implicit multiplication than using function calls in this way. But I agree that I don't really like any of these solutions (including my own). |
I'm not too familiar with how expressions are parsed in numbat, but it would be a lot more ergonomic if an expression like
x (y+2)
, forx
andy
both scalar constants, was simply evaluated using implicit multiplication once it became clear that a function call wasn't possible. In numbat 1.13 this fails with a constraint error message I don't know how to interpret, in 1.12 it simply tells me "Only functions and function references can be called." I guess this might make parsing tricky, but maybe it could be implemented as allowing primitive types to be "called" and falling through to multiplication there - that might be too much of a hack, though.The text was updated successfully, but these errors were encountered: