-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Move binary and unary operators to external functions #635
Comments
One problem is that when overriding external functions, the type checker makes wrong assumptions. |
The runtime type is not guaranteed, so it might be acceptable to just let the type checker make wrong assumptions and get errors at runtime when something is wrong. |
Another solution is to make a type error if one declares a function with same name and incompatible type as the one assumed by the type checker. |
Another solution is to add smarter type inference such that the type checker can handle all the cases where the output type depends on the type of the input. |
One problem is that |
A solution to the lazy problem is to add support for making external functions lazy, e.g. by specifying a default value to return, if the argument is evaluated to that value. This requires lazy functions to return same type as the argument which has a default value. |
Instead of treating binary and unary operators as special, they can be turned into external functions. This will simplify the runtime quite a bit.
The text was updated successfully, but these errors were encountered: