Type functions take any numeric type as arguments and return the same numeric type.
alignment(Type) Returns the alignment in bytes
alignment(@) of the Type as a Word. The
alignment is a constant power of
two. If the argument is an at sign,
the pointer alignment is returned.
span(Type) Returns the unpadded width in
span(@) bytes of the given type as a
Word. The span is a constant.
If the argument is an at sign,
the pointer width is returned.
Example: Obtaining the padded size of a type:
Pad = { alignment( type ) - 1 } /\ -span( type )
Size = -{ -alignment( type ) /\ -span( type )}
@cast(Pointer) Return the address in a pointer or the address
@cast(Variable) of a variable with the type of the target type.
The @cast function can only be used as the right
side of an assignment.
context(Variable) Returns a one if variable context is set.
Otherwize zero is returned. The result
is a Byte. The variable must be of a
type declared in a class with context
variables (see context.help).
signal(Variable) Returns a one if a variable is signaled.
The result is a Byte. The variable must be
of a type declared in a class with context
variables (see context.help).
Enumeration{*} Returns the position of the last value of an
enumerated type as the Enumeration type.
Enumeration{.Name} Returns the position of the item, .Name,
as the Enumeration type.
Enumeration{Integer} Returns the constant, Integer, Enumeration
position as the Enumeration type.
Enumeration{Expression} Returns the position given by the positive
Word expression as the Enumeration type.
byte{Expression} Coerce an expression to a Byte.
byte{Parcel} Returns the low order
byte{Word} Byte of an integer.
byte{Cell}
byte{Single} Returns the signed integer
byte{Double} part of the rounded argument
rounding as a Byte.
Fault: The argument is not between 127 and -128.
byte{Enumeration} Returns the position of the
enumeration as an unsigned Byte.
The enumeration must have under
256 elements.
byte{String} Returns the first character in
String or zero if String is null.
byte{String, Word} Returns a byte within a String.
If String is empty or Word indexes
past the String, 0 is returned.
Fault: Word <= 0
cell{Expression} Coerce an expression to a Cell.
cell{Byte} Returns the argument
cell{Parcel} sign extended to a Cell.
cell{Word}
cell{Single} Returns the signed integer
cell{Double} part of the argument after
rounding as a Cell.
Fault: Argument is not between 2^63-1 and -2^63
within the real number hardware precision.
cell{Enumeration} Returns the position of the
enumeration as a Cell.
double{Expression} Coerce an expression to a Double.
double{Integer} Return a signed argument as a Double. When
doublel{Single} converting a Cell, the low order bits are lost.
parcel{Byte} Returns a sign extended
parcel{Word} Byte or the low order
parcel{Cell} Parcel of a Word or Cell.
parcel{Single} Returns the signed integer part of
parcel{Double} the rounded argument as a Parcel.
Fault: Argument is not between 32,767 and -32,768.
parcel{Enumeration} Returns the position of the
enumeration as an unsigned Parcel.
parcel{@Pointer} When the pointer is set to a 16 bit value,
the value is returned. Returns zero when
the Pointer is null or set to an address.
@parcel{Integer} Return a 16 bit Integer value as a pointer.
The @parcel function can only be used as the right
side of an assignment.
single{Expression} Coerce an expression to a Single.
single{Integer} Return a signed argument as a Single. When
single{Double} converting a Cell, the low order bits are lost.
string{Integer} Convert the low order byte of Integer
to a one character String.
word{Expression} Cast an expression to a Word.
word{Byte} Returns the low order Word of a Cell
word{Parcel} or a sign extended Byte or Parcel.
word{Cell}
word{Single} Returns the signed integer part of the argument
word{Double} after rounding as a Word.
Fault: Argument is not between 2^31-1 and -2^31.
word{Enumeration} Returns the position of the
enumeration as a Word.