References in D

deadalnix deadalnix at gmail.com
Sun Sep 16 15:43:50 PDT 2012


Le 15/09/2012 16:23, Alex Rønne Petersen a écrit :
> On 15-09-2012 15:24, Henning Pohl wrote:
>> On Saturday, 15 September 2012 at 12:49:23 UTC, Russel Winder wrote:
>>> On Sat, 2012-09-15 at 14:44 +0200, Alex Rønne Petersen wrote:
>>> […]
>>>>
>>>> Anyway, it's too late to change it now.
>>>
>>> I disagree. There are always opportunities to make changes to things,
>>> you just have manage things carefully.
>>
>> I don't know if people really use the ability of references being null.
>> If so, large amounts of code will be broken.
>>
>> The best way to stay tuned for that change is to always pray references
>> to be valid, thus to do no explicit runtime checks.
>>
>> Are you using reference runtime checks in your current code?
>
> D has null references, so I use them. I would prefer option types, but
> they are too verbose in D as things stand.
>

It shouldn't be that hard to create a Nullable!T template.


More information about the Digitalmars-d mailing list