4 ms·
If it's meant to signify paths, why not use the sigil that everyone uses for path separation, i.e. /
by dscrd 12y ago
If it's meant to signify paths, why not use the sigil that everyone uses for path separation, i.e. /
- kibwen 12y agoBecause this is ambiguous in any language that uses that same character as the division operator. The compiler wouldn't be able to tell whether `foo/bar + 2` is "divide foo by bar, then add two" or "add two to the bar item found in the foo namespace". Theoretically it's solvable by requiring whitespace to surround all arithmetic operators, which is actually a bit of an intriguing proposition because it would then also allow you to use dashes in variable names and have it be unambiguous, i.e. `foo-bar/qux - baz / spam` would unambiguously mean "divide baz by spam, then subtract it from qux in the foo-bar namespace". But nearly all languages try to avoid this sort of whitespace dependence (look at the ancient furor over the `> >` requirement in C++), and it would be quite a reach for Rust to start championing it now.