[Vala] Null Coalescing Assignment Operator
- From: Edward Hennessy <ehennes sbcglobal net>
- To: vala-list gnome org
- Subject: [Vala] Null Coalescing Assignment Operator
- Date: Sat, 27 May 2017 16:46:30 -0700
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 operator be a reasonable addition to Vala?
Ed
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]