Next: Referable Data Types, Up: Types And Values [Index]
There are four proper intrinsic types, ‘cardinal’, ‘integer’, ‘real’ and ‘text’, and one improper ‘void’ intrinsic type.
The numerical types have a fixed size representation reflecting the machine native arithmetic. Typically, the type sizes expressed in bits are 32 or 64. As machine representations, the numbers are limited in range and precision. A 32 bit ‘integer’ allows values between and including -2,147,483,648 and 2,147,483,647.
Number and string values may be included with the aime programs. Such values are called literals and their type is determined upon their form.
Integer values may be introduced in base 10 when they are represented as sequences of digits and when they don’t start with a ‘0’, in base 8 when they do start with a ‘0’, or base 16 when the hexadigit sequence is preceded by a ‘0x’ mark. Base 8 specification will allow only the ‘0’ to ‘7’, while the base 16 allows two equivalent set of extra digits, ‘a’ to ‘f’ and ‘A’ to ‘F’.
‘-’ and ‘+’ signs may not strictly belong with the ‘integer’ syntax, and may be interpreted as unary operators.
‘integer’ literals may be suffixed by the superfluous ‘i’.
‘integer’ literal examples:
Character literals are recognized. Their aime type is ‘integer’. Escape sequences are interpreted as for string literals.
Character literal examples:
The type name may be shorten to ‘int’.
‘cardinal’ literals have a ‘z’ suffix, and otherwise the same ‘integer’ syntax.
Examples:
The type name may be shorten to ‘card’.
A ‘r’ suffix marks a ‘real’ literal. No suffix is required if a digit point is included. At least one of the integral and fractional parts need to be present. No dangling digit point is recognized for real literals with no fractional part. Only base 10 is allowed.
‘real’ literal examples:
A base 10 exponent may trail the real literals. It is to be introduced by an ‘e’ marker, an optional ‘+’ or ‘-’ sign and a decimal string.
Examples:
String literals are quoted. Escaping is recognized. The octal and the ‘'\a'’, ‘'\b'’, ‘'\f'’, ‘'\n'’, ‘'\r'’, ‘'\t'’ and ‘'\v'’ escape sequences are interpreted.
All characters (bytes) are permitted with the exception of the 0 coded. Intrinsic strings are 0 terminated.
Consequent string constants are interpreted as a single split string constant.
‘text’ literal examples:
Next: Referable Data Types, Up: Types And Values [Index]