Project Elvis

Meta jared771 at gmail.com
Wed Nov 8 02:23:55 UTC 2017


On Tuesday, 7 November 2017 at 13:43:20 UTC, user1234 wrote:
> On Monday, 6 November 2017 at 20:14:17 UTC, Meta wrote:
>> [...]
>> import std.stdio;
>> writeln(safeDeref(tree).right.right.val.orElse(-1));
>> writeln(safeDeref(tree).left.right.left.right.orElse(null));
>> writeln(safeDeref(tree).left.right.left.right.val.orElse(-1));
>>
>> vs.
>>
>> writeln(tree?. right?.right?.val ?: -1);
>> writeln(tree?.left?.right?.left?.right);
>> writeln(tree?.left?.right?.left?.right?.val ?: -1);
>>
>> The functionality is probably a good idea, but a library 
>> solution is doable today without any acrobatics.
>
> Show me a library solution that works fine with IDE completion 
> (so for the safe navigation operator, not the Elvis one).

Yes, this is unfortunately the one sticking point of a library 
solution, although if the front end becomes fully usable as a 
library it may be possible to an extent.


More information about the Digitalmars-d mailing list