Anonymous Structs
The struct type may be omitted from a struct literal. These literals may coerce to other struct types.
Anonymous structs may be completely anonymous i.e. without being coerced to another struct type.
Anonymous structs without field names may be created and are referred to as
tuples. These have many of the properties that arrays do; tuples can be
iterated over, indexed, can be used with the ++
and **
operators, and have a
len field. Internally, these have numbered field names starting at "0"
, which
may be accessed with the special syntax @"0"
which acts as an escape for the
syntax - things inside @""
are always recognised as identifiers.
An inline
loop must be used to iterate over the tuple here, as the type of
each tuple field may differ.