Why different operators? #1227
Unanswered
5t0v
asked this question in
Questions & support
Replies: 1 comment 4 replies
-
Good question, thank you! Currently all syntax bar record and tuple access are specialised to a single type, there is no other overloading. This means that we can unambiguously perform type inference without annotations. pub fn add(x, y) {
x + y
} If We would need to have an answer for this in order to have overloaded operators. This is a solvable problem but we need to be happy with the solution. It is easy to add overloading, it is hard to change it or to take it away, so it pays to be conversative when adding new language features. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why did you choose to have both
+.
and+
etc. Could you not find the correct type during compilation. It seems like a good candidate for reducing the complexity.Beta Was this translation helpful? Give feedback.
All reactions