List of reserved words

Alex Rønne Petersen alex at lycus.org
Thu Oct 11 11:52:49 PDT 2012


On 11-10-2012 20:20, monarch_dodra wrote:
> On Thursday, 11 October 2012 at 17:57:01 UTC, Jonathan M Davis
> wrote:
>> On Thursday, October 11, 2012 10:46:03 Ali Çehreli wrote:
>>> On 10/11/2012 10:13 AM, Jonathan M Davis wrote:
>>> > (arguably no one should really be using hash_t or equals_t > at this
>>>
>>> point, but
>>>
>>> > I don't know if they're ever going to actually go away).
>>>
>>> I've been assuming that they were relatively newer aliases. Is it
>>> recommended to use size_t and bool instead?
>>
>> They're old. equals_t was done because D1 uses (used?) int for opEquals
>> instead of bool. I don't know if there was ever a good reason for
>> hash_t to
>> exist. I don't believe that TDPL uses either, and I believe that
>> they've been
>> mostly removed from druntime and Phobos (if they haven't been entirely
>> removed
>> yet, they will be, aside from the aliases themselves).
>>
>> So, I would definitely recommend not using equals_t or hash_t, but
>> while some
>> of us are definitely looking to get rid of them entirely, I suspect that
>> they'll be around semi-permanently just to preserve backwards
>> compatibility.
>>
>> - Jonathan M Davis
>
> In C, *technically*, anything ending in _t is reserved for future
> usage, but this is not enforced.
>
> Does D also reserve those names? Shouldn't it?

In D, any identifier starting with two underscores is reserved for 
implementation-specific keywords/other magic.

http://dlang.org/lex.html#IdentifierStart

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list