Next: Side effects
Up: The new language
Previous: The new language
  Contents
Clearly, in order to do any useful work, we must define some set of
data types we wish to work with. Again, the virtual machine does not
yet implement everything one could wish for, but it does implement the
most basic types. The types are outlined in Table 3.2.1.
Table 3.1:
List of data types currently implemented in the virtual machine.
Type |
Description |
integer |
A 32 bit signed integer, used especially as loop variable
and for indexing in other types |
floating |
A 64 bit IEEE floating point type |
tuple |
A tuple can hold any number of elements. The elements can be
of any type. This is mostly used for argument passing, where it is
only possible to pass one argument to a function. One can pass a tuple
holding any number of elements (arguments), since the tuple is just
one argument. |
vector |
This is a vector that holds elements of type
floating. |
matrix |
This is a matrix holding elements of type floating. |
|
I felt these were the most basic and important types. The tuple type
is important because one can only pass one argument to a
sub-routine call, and sub-routines can only return one
argument. The tuple type can hold any number of elements of any type
(even tuples of tuples of ...), thereby allowing us to pass several
variables back and forth between sub-routine calls.
Some languages have multi-dimensional types. I have not yet
implemented -dimensional arrays, but in a sense the tuple type is
already -dimensional, so the basic functionality for handling
-dimensional variables is already present in the system. In the
meantime one can use a tuple of vectors or matrices, to simulate
-dimensional arrays.
Next: Side effects
Up: The new language
Previous: The new language
  Contents
1999-08-09