Primitive types

Argentum has very few primitive types:

  • int - a 64-bit signed integer
  • double - a 64-bit floating-point number
  • void - a no-value placeholder, to mark function has no returning value
  • (prospected) terminate a type that marks that a function never returns
  • bool - a single-bit two-state value (true-false), actually it's a synonym for optional(void)
  • (prospected) short - a 32-bit signed integer
  • (prospected) float - a 32-bit floating-point number

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;" // not yet implmented
  • For doubles: "field = 0.0;"
  • For floats: "field = 0.0f;" // not implemented
  • For bools: "field = false;"

Primitive types are passed and compared by value.

Leave a Reply

Your email address will not be published. Required fields are marked *