3 ms·
Without ad-hoc polymorphism and with explicit exports the correct one must have been disambiguated in import statements or must otherwise have been disambiguate
by dwohnitmok 5y ago
Without ad-hoc polymorphism and with explicit exports the correct one must have been disambiguated in import statements or must otherwise have been disambiguated at the call site via a namespace prefix (negating the need to do any searching at all).
So simple ctrl-f in the file would do (or the call site would identify it).
- masklinn 5y agoI've no idea what you're trying to say, but as far as I can interpret it when it comes to Rust you got things exactly backwards: foo().bar().baz() if everything is monomorphic, there is no requirement that the result of bar() be a member of a direct dependency, to say nothing of being imported into the local scope. If `baz()` is a member of a trait, however, that trait must be in-scope.
- dwohnitmok 5y agoI'm talking about a hypothetical other language without ad-hoc polymorphism (in the spirit of the original article comparing Rust against other languages such as e.g. Go) and also in this case without methods. One poster child for this kind of programming is Elm (there are several other even more niche languages that do this as well).