std.stringbuffer

Janice Caron caron800 at googlemail.com
Wed Apr 30 00:01:53 PDT 2008


2008/4/30 Me Here <p9e883002 at sneakemail.com>:
>  If a separate namespace is deamed /essential/, then I see no reason to go
> with, and certainly did "ask for" it to be called
>  the misleading name of std.StringBuffer. As far as I recall, that was
> Janice's own suggestion.

Yeah, I got that from an earlier post when someone said "What you need
is a string buffer" in response to some question.

The name can be anything we want it to be.


>  For preference, if a separate namespace is absolutely necessary, I go for:
>
>     std.string.mutable

Except "std.string.anything" :-)

"std.string" is a module, so it can't also be a package. That's a
limitation of the D language.

>  Finally, if the retention of unused but allocated space in an array is a
> feature of the current design, then I would add
>  a debug time warning indicating when a char[] has had to be grown. These
> could be used during devlopment to adjust
>  the preallocated size of arrays to be large enough to accomodate all (most?
> typical?) requirements.

I would support the addition of some function like

    gc.minimise(char[])

which returned all the unused space following the end of the array
back to the gc, without any copying of the used part. I wouldn't be
able to write that though - the gc is not my area of expertise.



More information about the Digitalmars-d mailing list