Is the first example of in http://fantom.org/doc/docLang/Expressions.html#collections correct? Shouldn't the third line read:
a, b, c, => it.add(a).add(b).add(c)
(note the comma after c)?
c
No you actually do not need the trailing comma - that is only required if you have one item to add. Simple example:
echo( [,] { 1, 2, 3 } )
If I understand correctly, the second line of that same example could also read:
a, b => it.add(a).add(b)
instead of:
a, b, => it.add(a).add(b)
?
Yeap you understand correctly.
Actually probably should remove that trailing comma from docs
Login or Signup to reply.
Henri Sat 13 Nov 2010
Is the first example of in http://fantom.org/doc/docLang/Expressions.html#collections correct? Shouldn't the third line read:
(note the comma after
c
)?brian Sat 13 Nov 2010
No you actually do not need the trailing comma - that is only required if you have one item to add. Simple example:
Henri Sun 14 Nov 2010
If I understand correctly, the second line of that same example could also read:
instead of:
?
brian Sun 14 Nov 2010
Yeap you understand correctly.
Actually probably should remove that trailing comma from docs