4 ms·
Another practical difference is that you can implement multiple traits for a given struct which require a method with the same name and same/different signature
by LukaD 7y ago
Another practical difference is that you can implement multiple traits for a given struct which require a method with the same name and same/different signature. The compiler always knows which trait implementation the code is calling so the names implementations don't clash.
- ajross 7y agoNot to pick on you two: but a feature that implements the same concept modulo changes to the source code like friend declarations (first example) or naming (second) is the very definition of a merely syntactic difference. Rust represents the same stuff, it just does it in funny ways. That was my point.
- DougBTX 7y agoYes, I avoided the “semantic” question as it seems very slippery, it could easily devolve to “Rust is turing complete so it is just the same as any other language”. Out of interest, do you have any examples that you would consider semantically different, while still being appropriate for day-to-day programming?