Rename std.string.toStringz?
Jonathan M Davis
jmdavisProg at gmx.com
Thu Jun 16 10:19:30 PDT 2011
On 2011-06-16 09:21, Adam D. Ruppe wrote:
> Jonathan M Davis wrote:
> > I'm afraid that I don't understand this view at all, given that
> > string is a word and stringz isn't, though there are a few people
> > that have expressed this view now.
>
> If we had a function for to!ulong in this style, would you call it
> toULong or toUlong?
>
> I'd expect the latter - the word is "ulong", a single unit,
> not "U Long".
>
> D1 also did it this way:
> http://digitalmars.com/d/1.0/phobos/std_conv.html
I'd probably end up calling it to ULong, since U stands for unsigned and it
looks a lot better that way, but since ulong is a type name, I could easily
see it being named toUlong.
However, I don't see what that has to do with toStringz. stringz is neither a
type nor a word. The _only_ place that stringz is used AFAIK is in the name
toStringz, where the zero presumably stands for zero, as in zero-terminated
string. If stringz were a type in D, then yeah, toStringz would be properly
camelcased, but stringz isn't a type.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list