(some literal expressions are also described in data types)
A literal is a way to specify an unnamed constant value corresponding to a given data type. GAML supports various types of literals for often — or less often — used data types.
Values of simple (i.e. not composed) types can all be expressed using literal expressions. Namely:
100, or hexadecimal value if preceded by
#AAAAAA, which returns the int
'.'for the decimal point (e.g.
'my string') or double quotes (
Although they are not strictly literals in the sense given above, some special constructs (called literal constructors) allow the modeler to declare constants of other data types. They are actually operators but can be thought of literals when used with constant operands.
Finally, a special literal, of type
unknown, is shared between the data types and all the agent types (aka species). Only
float, which do not derive from
unknown, do not accept this literal. All the others will accept it (e.g.
string s <- nil; is ok).
nil, which represents the non-initialized (or, literally, unknown) value.