Proposal for std.path replacement

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Sun Mar 6 04:31:20 PST 2011


On Sat, 05 Mar 2011 16:32:55 +0000, Lars T. Kyllingstad wrote:

> On Fri, 04 Mar 2011 08:14:44 -0500, Nick Sabalausky wrote:
> 
>> "Lars T. Kyllingstad" <public at kyllingen.NOSPAMnet> wrote in message
>> news:ikofkc$322$1 at digitalmars.com...
>>> As mentioned in the "std.path.getName(): Screwy by design?" thread, I
>>> started working on a rewrite of std.path a long time ago, but I got
>>> sidetracked by other things.  The recent discussion got me working on
>>> it again, and it turned out there wasn't that much left to be done.
>>>
>>> So here it is, please comment:
>>>
>>>    http://kyllingen.net/code/ltk/doc/path.html
>>>    https://github.com/kyllingstad/ltk/blob/master/ltk/path.d
>>>
>>>
>> I don't want to jinx it, but there seems to be a lot of agreement in
>> this thread. Seriously, how often does that happen around here? :)
> 
> Not too often, so I take it as a good sign that I'm onto something. ;)
> 
> The only disagreement seems to be about the naming, so let's have a
> round of voting.  Here are a few alternatives for each function.  Please
> say which ones you prefer.
> 
>  * dirSeparator, dirSep, sep
>  * currentDirSymbol, currentDirSym, curDirSymbol * basename, baseName,
>  filename, fileName * dirname, dirName, directory, getDir, getDirName *
>  drivename, driveName, drive, getDrive, getDriveName * extension, ext,
>  getExt, getExtension * stripExtension, stripExt
> 
> (The same convention will be used for stripExtension, replaceExtension
> and defaultExtension.)


In summary, it seems currentDirSymbol, baseName, dirName and driveName 
are clear winners.  Less clear, but still voted for by the majority, are 
extension and stripExtension.  It is a tie between dirSep and 
dirSeparator.

Below are the votes I counted.  And before you say "hey, I didn't know we 
could make suggestions of our own", or "why did that guy get several 
votes?", this was by no means a formal vote.  It was just trying to get a 
feel for people's preferences.  Before the module gets accepted into 
Phobos there will have to be a formal review process, so there is still a 
lot of opportunity to fight over naming. :)

dirSep: 3 (Nick Sabalausky, spir, Jonathan M. Davis)
dirSeparator: 3 (Bekenn, Jim, J Chapman)

currDirSym: 1 (Jonathan M. Davis)
currDirSymbol: 2 (Nick Sabalausky, Jonathan M. Davis)
path.current: 1 (Andrej Mitrovic)
currentDirSymbol: 4 (Bekenn, Jim, J Chapman, spir)

baseName: 6 (Nick Sabalausky, Bekenn, Jim, J Chapman, spir, Jonathan M. 
Davis)
baseFileName: 1 (Nick Sabalausky)
fileName: 1 (spir)
basename: 1 (Andrei Alexandrescu)

dirName: 6 (Nick Sabalausky, Bekenn, Jim, spir, Jonathan M. Davis, David 
Nadlinger)
directory: 1 (Nick Sabalausky)
getDirName: 2 (J Chapman, spir)
dirname: 1 (Andrei Alexandrescu)

driveName: 4 (Nick Sabalausky, Bekenn, Jim, spir)
drive: 2 (Nick Sabalausky, Jonathan M. Davis)
getDriveName: 2 (J Chapman, spir)
driveLetter: 1 (Jonathan M. Davis)

ext: 1 (Nick Sabalausky)
extension: 2 (Bekenn, Jim)
getExtension: 1 (J Chapman)

stripExt: 2 (Nick Sabalausky, Jonathan M. Davis)
stripExtension: 3 (Bekenn, Jim, J Chapman)


More information about the Digitalmars-d mailing list