[Issue 10203] std.string.toUpperInPlace is... not in place

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 21 14:26:35 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10203



--- Comment #6 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-09-21 14:26:34 PDT ---
(In reply to comment #5)
> (In reply to comment #2)
> 
> > It seems to me that, overall, toLowerInPlace is a function that is broken, that
> > cannot respect the specs it promises, and violates the principal of least
> > surprise in regards to behavior.
> > 
> > I think it should either be tagged with a massive red unsafe, or deprecated.
> 
> Even if it's impossible for Unicode strings, I'd like to keep a version of it
> for just arrays of ASCII chars, that is a common enough use case.

It also works quite well for UTF-16. And it does now. 
And I would have kept it if only because of backwards compatibility
perspective.

There is no other primitive yet, but a version(s) with output range for all
string transformations is something to look forward to.

The only question is whether or not should this function try to use extra
capacity beyond the length if it's present (that would make InPlace suffix look
saner).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list