Types

Rapture has three built in data types currently (ignoring the types in databases).  These types are used when declaring variables, passing parameters, and generally pushing data around to do some useful work.  Each type can be identified by a designating trailing character (or lack thereof) on any variable or function or parameter names.  For instance:

local string$;     (* A local string variable *)

As you can see, the trailing character indicates the type, unless there is no such special character, in which case the type is assumed to be an integer.  A breakdown of the special characters and their corresponding type information follows.

(none)Integer.  The variable holds a 4 byte signed integer value.
$String.  The variable holds an arbitrary length string of (single byte) characters.
@Vector.  The variable holds a reference to a an array (or list, depending on your interpretation) of either integer or string values.

Let’s see a simple example of each.

local int;       (* An integer local variable *)
local string$; (* A string local variable *)
local vector@; (* A vector local variable *)
function foo(); (* A function returning an integer *)
function bar$(); (* A function returning a string *)
function baz@(); (* A function returning a vector *)

Each type has different operations defined for it, see Operators for more information.

Operators are what connect various terms of an expression and supply the meaning of each.