std.path.toAbsolutePath / toNormalizedPath / toRelativePath
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 25 07:24:46 PDT 2015
On Thursday, 25 June 2015 at 13:35:30 UTC, Vladimir Panteleev
wrote:
> On Tuesday, 23 June 2015 at 22:45:10 UTC, Vladimir Panteleev
> wrote:
>> http://dump.thecybershadow.net/0362443dfcca30860db907e494831b79/names.diff
>
> Rationale:
>
> - The eager versions are called absolutePath, normalizedPath,
> relativePath. If anything, the current naming scheme is
> opposite to some options we've been discussing (e.g.
> eager=toLowerCase, lazy=lowerCase[d|r]).
>
> Suggested new names: asAbsolutePath, asNormalizedPath,
> asRelativePath.
>
> Couldn't think of anything better, but I think this is an
> improvement. If we are to adopt the "as" prefix, we could also
> go with asLowerCase/asUpperCase for the std.uni ones.
That seems like a reasonable idea for the cases where we really
don't have a noun to act as the one doing the action. The
situation is weird enough with uppercase and lowercase, since you
end up with stuff like upperCaser and lowerCaser when caser isn't
really a thing, but at least there, we at least have a fake noun
that makes sense. For the path ones, I don't see any kind of noun
that makes sense. So, asAbsolutePath, etc. definitely makes some
sense, so maybe asLowerCase and asUpperCase would make more sense
too. In general though, I'd prefer that we go with the noun
naming scheme - particularly when they're basically constructors
for ranges. But it obviously doesn't work in all cases.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list