std.path review: update

torhu no at spam.invalid
Thu Jul 21 07:48:43 PDT 2011


On 17.07.2011 23:27, Lars T. Kyllingstad wrote:
> - Should it be specified/documented whether a function returns "" or
> null?  Specifically, is it important that
>
>      extension("foo") is null
>      extension("foo.") !is null&&  extension("foo.") == ""

I guess you've already thought about this, but one solution is to just 
return the dot as part of the extension.  Then you get extension("foo.") 
== ".".  I noticed that .NET's getExtension method does this.

setExtension and defaultExtension would probably have to change to at 
least accept extensions that include the dot, if extension() is changed.


More information about the Digitalmars-d mailing list