builtins

Builtin types and functions. More...

Types

type Any;
type Array < Any;
type Bool < Any;
type Byte < Any;
type Char < Any;
type Double < Any;
type Error < Any;
type Float < Any;
type Function < Any;
type Int < Any;
type Long < Any;
type Short < Any;
type String < Any;
type Structure < Any;

Functions

def acopy(src: Array, sofs: Int, dest: Array, dofs: Int, len: Int);
def Any.tostr(): String;
def chstr(ch: Char): String;
def String.ch(at: Int): Char;
def String.len(): Int;
def String.substr(from: Int, to: Int): String;
def Structure.clone(): Structure;

Description

These types and functions are builtin and do not require any use statement.

Type details

type Any;
Parent type of all other types.

type Byte < Any;
Byte value. Values of this type are signed integer numbers in range from −128 to 127.

type Short < Any;
Short integer value. Values of this type are signed integer numbers in range from −32768 to 32767.

type Char < Any;
Character value. Values of this type are unsigned integer numbers in range from 0 to 65535.

type Int < Any;
Integer value. Values of this type are signed integer numbers in range from −231 to 231−1.

type Long < Any;
Long integer value. Values of this type are signed integer numbers in range from −263 to 263−1.

type Float < Any;
Single precision floating point number.

type Double < Any;
Double precision floating point number.

type Bool < Any;
Boolean value. Values of this type are true and false.

type String < Any;
A sequence of characters.

type Array < Any;
Parent type or all array types.

type Structure < Any;
Parent type of all structure types.

type Function < Any;
Parent type of all functional types.

type Error < Any;
Error thrown in exceptional situations. See error.eh for details.

Function details

def Any.tostr(): String;
Returns string representation of the value. If value is: It is safe to call this function for values of other types but returned values are platform dependant and you should not rely on them.

def String.len(): Int;
Returns length of the string.

def String.ch(at: Int): Char;
Returns character at given position in the string. You may also use square brackets, as with array.

def String.substr(from: Int, to: Int): String;
Returns substring of the string. Returned substring contains all characters in range from..to-1.

def chstr(ch: Char): String;
Returns string containing single character.

def acopy(src: Array, sofs: Int, dest: Array, dofs: Int, len: Int);
Copies len elements from array src starting at index sofs to array dest starting at index dofs.

def Structure.clone(): Structure;
Clones structure. The returned value is new structure of the same type with all fields copied from the old structure.