std.stringbuffer

Pedro Ferreira ask at me.pt
Fri May 2 15:39:45 PDT 2008


Janice Caron escreveu:
> Hi all,
> 
> More than one person has complained about the lack of string functions
> in Phobos which operate on mutable chars. In the thread titled "Is all
> this Invariant ****....", I suggested creating a new module,
> std.stringbuffer, to contain two things:
> 
> (1) a StringBuffer class
> (2) parallel mutable versions of the functions in std.string.
> 
> Walter OKed the idea, so it looks like that's a go. To that end, I've
> looked through the functions in std.string and sorted them into
> different groups. I think it's important to get the API right so
> comments are welcome on all of the below:
(snip)

I agree with this and will welcome the module. I've had to do some ugly 
.idup and .dup around a compiler I coded to accomodate for various 
functions around Phobos (such as writeLine from OutputStream).
I'd like to suggest, though, the usage of template code:

T[] split(T)(in data)

and perform a static if inside. It'd save the assle of maintaining two 
modules in seperate, which are bound to have different functions some 
day. For example,say that a function is added to std.string and not to 
std.stringbuffer.
Also, it would be easier to maintain documentation consistency.
On an extra note, ASCII UTF variants could be taken care in a single 
function.
That would require a lot of work though. Well, should you require 
assistance, gimme a shout.


Cheers



More information about the Digitalmars-d mailing list