-
Notifications
You must be signed in to change notification settings - Fork 55
Overload some operators #375
Comments
I'm not sure about doing operator overloading for numbers just yet, because it can get confusinga. We should first sort out the numeric type situation, and then choose operators based on which numeric types will be most common. In the meantime, if +i bothers you, we can do +. for float addition and + for integer addition, as in OCaml. I think ++ is okay for string concatenation. Otherwise people will keep trying to do Field access can definitely be overloaded, possibly just by modifying the syntactic sugar? @jeromesimeon what's the top brand in the brand relation? I'm thinking compiling |
About field access: I don't think I can tell if it's working without knowing what the typing rule for |
Some core support for overloaded operators is in place. It's quite conservative, doing static dispatch for clearly identified pairs of types:
It also overloads Now that the infrastructure is in place, we can decide to expand on this or not based on user experience and feedback. |
Note: Possible other candidates for using operators include:
|
Now that we have a proper type checker, we could consider overloading some of the operators and consolidate the syntax for those. Some prime candidates:
The text was updated successfully, but these errors were encountered: