Null references

Peter Alexander peter.alexander.au at gmail.com
Tue Aug 21 13:13:00 PDT 2012


On Tuesday, 21 August 2012 at 14:29:56 UTC, Simen Kjaeraas wrote:
> On Tue, 21 Aug 2012 16:08:23 +0200, Carl Sturtivant 
> <sturtivant at gmail.com> wrote:
>
>>>> On the other hand, the suggested syntax of 
>>>> "bob?.department?.head?.name" from Kotlin is pure genius, 
>>>> and has a
>>>> good chance of actually being used.
>>> Absolutely. Probably hard to include in D though, as a ? .b 
>>> is the beginning of a conditional expression.
>>
>> How about
>>
>>   bob??.department??.head??.name
>
> I guess that could work. Still won't happen though, but for 
> other reasons.
>
> Also, reminded me of C's WTF operator:
>
> foo ??!??! exit(1);

That's brilliant. Surprised I haven't seen that before.



More information about the Digitalmars-d mailing list