set phrases, data sections, and type and function return default values all
support value initialization. There are two types of initialization in ARF:
simple and complex.
Simple initialization is just a single argument that is sufficient for setting
the value of a simple thing such as an Int. However, objects and arrays require
more than that. This is where complex initialization comes in.
An indented block under a...
- Data section
- Type section
- Enum section member
- Objt section member
- Set phrase
- Function ouput declaration
... is to be treated as a complex initialization. There are two types of complex
initialization: object and array. Array initialization is simple, it is just a
list of values of the same type. The following array initializations are
syntactically and semantically valid:
Object initializations allow setting the values for an entire object, including
its constituent parts:
The parser is able to differentiate between the two because in an object
initialization block, every member is preceded by a dot. Object initialization
members may nest - they may have array initializations in them, or even other
object initializations.