> From: Guillaume Poirier-Morency <guillaumepoiriermore...@gmail.com>
> Sent: Sunday, 28 May 2017, 16:59
> Subject: Re: [Vala] Null Coalescing Assignment Operator
> Le dimanche 28 mai 2017 à 10:20 +0200, Ulink a écrit :
> > > thing = thing ? create ();
Le dimanche 28 mai 2017 à 10:20 +0200, Ulink a écrit :
> > thing = thing ? create ();
>
> I think you meant
>
> thing = thing ?? create ();
Yeah, my mistake! Evan actually pointed that out first on IRC.
>
> Edward seems lazy and don't want to write "thing" two times ;-)
What I think we
> thing = thing ? create ();
I think you meant
thing = thing ?? create ();
Edward seems lazy and don't want to write "thing" two times ;-)
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list
What's wrong with:
thing = thing ? create ();
Le samedi 27 mai 2017 à 16:46 -0700, Edward Hennessy a écrit :
> This snippet shows a common implementation of lazy initialization:
>
> if (thing == null)
> {
> thing = create();
> }
>
>
> It would be nice to have a
This snippet shows a common implementation of lazy initialization:
if (thing == null)
{
thing = create();
}
It would be nice to have a concise form using a null coalescing operator, like:
thing ??= create();
Would a null coalescing assignment