October 29, 2004
Antti Sykäri wrote:

> So we have them. Hurray. Not that I will (at least initially) want to
> touch anything equipped with the dreaded '_t' suffix from the C era, but
> at least we have them.
>
> And to think of the fact that the original reason for rejecting them was
> that they are not "aesthetically pleasing". Heh.
> 
> I suppose that the _t suffix should be added to the D style guide as the
> official suffix denoting ... umm, what does it denote actually? You
> don't use it in every alias, do you?

I think that it stands for "typedef" (the name of alias in C),
but the main reason is so that they would be totally different...

Since people already had all kinds of aliases defined locally,
the new standard one had to stand out a little.

http://www.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html

It also gets rid of the "but it could be confused with a number",
since it no longer ends in any numeric characters... Or something?

In D, you can also find the suffix in the standard aliases:
"size_t" (either 32 or 64) and "ptrdiff_t" (either 32 or 64)

>>I posted the suggestion of std/stdutf.d to the item list:
>>
>>module std.stdutf;
>>
>>/* Code units */
>>
>>alias  char utf8_t;
>>alias wchar utf16_t;
>>alias dchar utf32_t;
> 
> Thumbs up for this. I don't remember what char, wchar and dchar mean,
> but utf8(_t) makes it instantly crystal clear.

I'm willing to put it in the Public Domain :-)

Since they are optional modules, you can still use the built-in types...
But at least this should standardize the "alternative" names, I think ?

--anders
1 2 3 4
Next ›   Last »