Is [] mandatory for array operations?

Kagamin spam at here.lot
Thu May 6 11:28:44 PDT 2010

Don Wrote:

> Two questions. (1) What happens with functions? For example:
> x[] = sin(y[]);
> OR
> x[] = sin(y[])[];
Array op is effectively a statement-wide operation (it can be even deemed as a statement itself), braces are the hint which arrays are iterated. Since sin's result is not an array, you can't apply array op to it, so the first syntax is correct.

More information about the Digitalmars-d mailing list