cedric
06/12/2016, 2:20 PMappendIf
is useful more broadly too. For example, I often need to build a list that's either (a)
or (a,b)
for a certain condition:
val l = buildList {
a
if (condition) b
}
Without it, not much choice besides making l
a var