expr
expr copied to clipboard
Deep nil coalescing `??`
Right now, in order to use ?? user have to use ?. instead of . in nested structures.
events[0]?.labels?.value ?? 'defaul'
My idea is to make left hand side of ?? optional by default. So in case user written:
events[0].labels.value ?? 'defaul'
All member accesses to label/value/events will be optional. As well as array element access.
I really like this idea and think it makes much sense.
Also implement opcode to do chained optional fetch
@antonmedv : I have addressed these issues in the pull request. Could you please review this PR #583
Cool! Will take a look!