[phobos] next release (meaning of path)

SHOO zan77137 at nifty.com
Thu Sep 16 04:27:17 PDT 2010


(2010/09/16 0:45), Jonathan M Davis wrote:
> On Wednesday 15 September 2010 05:06:58 SHOO wrote:
>> I think that these features should be refined more, too. I am confused
>> that the handling of strings and path are mixed.
>
> A path _is_ a string. It's a string which indicates where on the file system a
> file is located. All of the functions in std.path are, therefore, string-related.
> However, they all relate to paths as opposed to strings in general, so I don't
> see what's mixed about them.
>
> - Jonathan M Davis

That is right.
However, what about vice versa? string is not path in some cases.

For example, the thing which "exists" means may not be a file. (URL, 
ISBN, words, system specialized function, and so on. Strings may not 
show only a pass.)
The thing which "join" connects may not be a pass. (You cannot guess 
result of join("path", "to", "the", "file") is "path/to/the/file" or 
"topaththepathfile". And this brings on conflict between std.string.join 
and std.path.join)
You cannot be convinced that "getSize" is the capacity of the file. (It 
may be the allocated memory size or the NIL terminated string length.)

This is only a part of the examples.
Users have wrong how to use if users will not treat it carefully.


More information about the phobos mailing list