Re: [Vala] Null Coalescing Assignment Operator

2017-05-28 Thread Al Thomas via vala-list
> 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 ();

Re: [Vala] Null Coalescing Assignment Operator

2017-05-28 Thread Guillaume Poirier-Morency
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

Re: [Vala] Null Coalescing Assignment Operator

2017-05-28 Thread Ulink
> 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

Re: [Vala] Null Coalescing Assignment Operator

2017-05-27 Thread Guillaume Poirier-Morency
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

[Vala] Null Coalescing Assignment Operator

2017-05-27 Thread Edward Hennessy
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