because how do you parse
let x = a/foo();
is that a::foo() or a / foo()?If you use \ it's unambiguous, a\foo() corresponds to a::foo() while a/foo() is division
So, why again is :: such a bad choice, given all this?
Even for windows paths, backslash has caused a lot of problems in various tools[1][2][3]. Just google "backslash path error" for many pages of problems. Even early DOS developers weren't happy with the need for backslash, and made regular slashes work in paths. That doesn't work everywhere in Windows, but it works in a lot of places. Following Microsoft's mistake because of an accident of history (they has already used forward slash for command flags before implementing path hierarchies so needed a different character) and dealing with the same problems they have is not a point in backslash's favor.
> :: is two characters and is only familiar for C++ programmers
It's familiar for whoever learns it for the language they are learning. That it does not necessarily have an association with concepts from other languages or systems that don't apply cleanly (such as the namespace corresponding to the path, which may not be true) is a positive.
1: https://pythonconquerstheuniverse.wordpress.com/2008/06/04/g...
2: https://github.com/rstudio/shiny/issues/1009
3: http://www-01.ibm.com/support/docview.wss?uid=swg21635233
use foo::bar;
doesn't actually use a relative "path" from the current moduleyou need to use
use self::foo::bar;
I think this is a confusing default, and it would have never ended up this way if Rust used Windows-path-looking namespace syntaxif you're writing a parser and manipulating actual arrays of bytes, you don't have an issue with backslash, it's just another character to you