Safe Navigation Operator “?.” for D2 ?

Robert Clipsham robert at octarineparrot.com
Thu Feb 27 09:02:01 PST 2014


On Thursday, 27 February 2014 at 16:32:18 UTC, Chris Williams 
wrote:
> On Thursday, 27 February 2014 at 16:08:26 UTC, Robert Clipsham 
> wrote:
>> D doesn't need this, you can implement monadic null checking 
>> in the library:
>
> By that argument, I can implement anything that D can do in 
> assembler, hence I don't need D.

I'm not sure I understand your point. I'm simply stating that in 
D, right now, without adding any complexity to the language, you 
can do:

just(myObject).method1().method2().method3()

Which would have the same effect as:

myObject?.method1()?.method2()?.method3()

in C#. Is a special operator really needed for this?

Robert


More information about the Digitalmars-d mailing list