
on Thu May 29 2008, Martin Wille <mw8329-AT-yahoo.com.au> wrote:
Beman Dawes wrote:
Beman Dawes wrote:
...An alternative set I'd be comfortable with would be tail() for the current leaf() and head_path() for the current branch_path().
Hum... After sending that, I read Johan RĂ¥de's "parent" suggestion.
I really like parent_path() for the current branch_path().
Sorry for the bikeshedding, but I really don't like parent_path. The problem I see is related to symbolic links. "parent" suggests a parent directory, even though parent_path() might return something that is not the parent directory of a link target. I think the naming should reflect the fact that we're operating on names only, not on an actual filesystem structure. So, IMHO, "basename" is a better choice than anything containing "parent".
Is this yet another alternate meaning for "basename?" Nobody has suggested using it to drop the last path element before, AFAIK. I would make the same argument with you as I have with Beman: "basename" has an accepted meaning in the domain of filesystem APIs. We can't use the same name to mean something different. -- Dave Abrahams BoostPro Computing http://www.boostpro.com