Next: , Previous: Array concatenation, Up: Aggregates references


4.6.2 Array construction

The syntax for building higher-dimension arrays:

array-construction : { construction-list } construction-list : construction-list , complex-expr-term | complex-expr-term

Semantics: This construct takes N-dimension references and produces an N+1-dimension array of references. Technically, each element is first promoted one dimension (creating an N+1-dimension array with leading dimensions size [1]) and the results are then concatenated. The following are equivalent: { x, y } vs. {x} # {y}. The dimension constraint for matching trailing dimensions also applies here. This construction is valid for both meta-expressions and instance-references.

Example: This is most commonly used for grouping scalars into a 1D-array.

Status: implemented