DMD 2.064 changelog typo?
monarch_dodra
monarchdodra at gmail.com
Tue Oct 29 13:56:01 PDT 2013
On Tuesday, 29 October 2013 at 10:08:00 UTC, Sergei Nosov wrote:
> I guess it's a good thing, it's available online. While looking
> through it, I also noticed that there are new functions
> 'stripLeft/stripRight'. I believe it would be more consistent
> to call those stripFront/stripBack.
Yes, it would be, but they are also a generalization of the
eponymous string functions. Naming the new functions
"stripFront/stripBack" instead of "stripLeft/stripRight" would
itself be the more inconsistent.
For example:
//std.string.stripLeft
assert(stripLeft(" \tHello") == "Hello");
//std.algorithm.stripLeft(R, E)(R r, E e);
assert(stripLeft(" \tHello", ' ') == "\tHello");
//std.algorithm.stripLeft(alias pred, R)(R r);
assert(stripLeft!(Not!isLower)(" \tHello", ' ') == "ello");
But you make a valid point.
More information about the Digitalmars-d
mailing list