On Monday, 9 March 2015 at 14:42:35 UTC, Adam D. Ruppe wrote:
On Monday, 9 March 2015 at 14:38:41 UTC, Dennis Ritchie wrote:
(1, 2, 3).writeln; // prints 3
that's not an array, use [1,2,3] for that.
What you wrote is a parenthesis expression with comma
expressions inside. The comma operator is a bit weird: it works
like a semicolon, but in different contexts.
So 1,2,3, in this context, means "calculate 1, then calculate
2, then calculate 3, the result is the final one: 3". The 1 and
2 are just discarded because their calculations don't save
anything outside.
Thanks.
On Monday, 9 March 2015 at 14:48:20 UTC, John Colvin wrote:
I think this is a misunderstanding about UFCS.
Yes.