Argentum has very few primitive types:
int
,short
- 64-bit and 32-bit signed integersdouble
,float
- 64-bit and 32-bit floating-point numbersvoid
- an empty no-value placeholder, for for callables returning no value.noreturn
a type that marks that a function never returns (compatible to all types)bool
- a single-bit two-state value (true-false), actually it's a synonym for optional(void)
Argentum allows to work with 8-bit, 16-bit, 32-bit, 64-bit types in a raw data structures with the help of sys_Blob
class. This is mostly useful for interop with C or other languages.
When declaring object fields, constants or local variables, their types are always inferred from the initializer value.
The shortest and simplest way of field declaration is (although all expressions of the compatible types are equally acceptable):
- For int type : "
field = 0;
" - For short: "
field = 0s;
" - For doubles: "
field = 0.0;
" - For floats: "
field = 0.0f;
" - For bools: "
field = false;
"
Primitive types are passed and compared by value.
See also: 32-bit short and float types