3 ms·
It would need it if it had it. How do I find your code that adds bananas together using a banana adding operator via a text name?
by zid 9y ago
It would need it if it had it. How do I find your code that adds bananas together using a banana adding operator via a text name?
- kibwen 9y agoIf you're referring to the ability to define entirely new symbolic operators like you can do in Haskell and Scala, then you'll be happy to hear that Rust doesn't support such a thing. (Frankly, I'm happy about it too. :P ) Rust only allows you to overload a fixed set of operators, and that overloading is all done via traits with well-known names (e.g. overloading the plus symbol "+" is done via implementing std::ops::Add for a type), and traits too can be effectively treated like namespaces as far as symbols are concerned.