The basic types in Wrapl are provided by the modules in Std.*. To convert from one type to another, one uses the conversion operator @.
All variables in Wrapl must be declared, using VAR ident;. To assign a value to a variable, use ident <- value;, before assigned a value, variables have the value NIL. A variable can be assigned a value when declared, using VAR ident <- value;, this will have the same effect as VAR ident; ident <- value;. Several variables can be declared in the same VAR declaration by separating them with commas.
The assignment operator <- returns the assigned value, so that several variables can be assigned the same value in one expression.
Within the interactive interpreter, the predeclared variable _ holds the result of the last evaluated expression.
Wrapl provides support for integers of arbitrary precision (limited only by available memory).
Integers by default are written in decimal (base 10), but can be written in other bases by preceding the number with the base, in decimal. Integers are normally converted to strings in decimal, but other bases can be used by passing the base as an additional parameter to @.
Wrapl provides rational numbers of arbitrary precision. Rationals can be written as numerator/denominator, with no space around the /. Rationals are returned by any division involving integers where there is a remainder. To get the integer part of a division involving integers, use :div or :floor.
Real numbers are stored in Wrapl using the standard (IEEE 754, double precision) floating point representation. It is possible to convert between real numbers and rationals. Converting a rational to a real will usually result in a loss of precision.
Strings in Wrapl can be entered in one of three ways. More information can be found here.
Strings in Wrapl are immutable, new strings can be constructed by concatenation (using +), taking substrings (using []) and repetition (using *). String indices begin at 1 for the first character through to string:length for the last. In addition, negative indices start from the end of the string, -1 being the last character. Substrings are inclusive of the first index and exclusive of the last.