xsharp.eu • null-coalescing operators
Page 1 of 1

null-coalescing operators

Posted: Mon Jan 15, 2024 5:01 pm
by baramuse
Hi all,

I can't recall from the last summit if the null-coalescing operators are now supported by XSharp 2.18 ?
I've read in the forums that, yes, it's part of the 2.18, but can't find it in the "what's new" document.

Also what syntax is actually supported ?
I'm looking for the

Code: Select all

??=
one for example, would it be

Code: Select all

??:=
in X# ?

https://learn.microsoft.com/en-us/dotne ... g-operator

Regards.

Re: null-coalescing operators

Posted: Mon Jan 15, 2024 10:31 pm
by robert
Basile,
The null coalescing assign operator can be used like this, just like in C#

a ??= b

we also support

a := a ?? b

which is equivalent to

a := a DEFAULT b


Robert

Re: null-coalescing operators

Posted: Tue Jan 16, 2024 7:47 am
by baramuse
Awesome, thanks !