[nem-en] Operator ??

Igor Tkachev it at rsdn.ru
Sat Sep 30 01:59:02 CEST 2006


Hello Ivan,

> Here is the macro and testes:

I have another exercise for macro-writers :)

What about '??='

It should implement the following pattern:

mutable a;
def b =
{
  when (a == null)
    a = GetSomeValue();
  a;
}

(btw, can we use this syntax?)

With ??= it could look like the following:

mutable a;
def b = a ??= GetSomeValue();

What do you think?

-- 
Best regards,
Igor
mailto:it at rsdn.ru





More information about the devel-en mailing list