30 Mar
2016
30 Mar
'16
7:55 a.m.
On 30 March 2016 at 05:23, Chris Angelico <rosuav@gmail.com> wrote:
4) Path("file:///http://www.example.com")
Oops, my bad - I forgot about the third slash. It comes to the same thing, though; for most paths, you can deduce that a prefix "http://" implies that it's not a file path, and for the rare case when you do mean that, you can explicitly adorn it.
I presume you're deliberately ignoring the fact that most paths come from variables, not from literals, and many come from user input (sometimes even unintended user input such as a "*" expanded by the shell)? It's easy enough to rewrite literals to be unambiguous, but in order to do so for arbitrary input you need to basically implement (part of) a URI parser... Paul