Object Hierarchy

Scan your eyes down over Figure [*] which shows the hierarchical structure of objects in RLaB  - we shall now describe this figure from the bottom up (ignoring lists until a little later). Not all objects are created in the same way and what you can do with or to them depends on their class. Items of class function contain program instructions which is one form of data or information. Items of class numeric, and string contain data that RLaB  instructions can manipulate.

Figure: RLaB objects
\begin{figure}\begin{picture}(350,300)(0,25) % (x-size, y-size) (x-shift, y-shif...
...s
angle=0 hscale=65 vscale=65 voffset=-55 hoffset=40}
\end{picture}\end{figure}

A numeric class item can store a real or complex number. An item of class string contains a null-terminated string of character(s). When we want to access or create an array of items, we use an array syntax that is the same for both string and numeric classes.

It is often helpful to a programmer to group together unlike data into a single object - this is the purpose of the class list. We are not going to describe it in great detail here except to point out that it serves a similar role to a record in Pascal or a structure in C, but with a somewhat more flexible access mechanism. Note that lists can contain any of the aforementioned objects, even another list.

One thing that you can always do with any item is ask RLaB  what its class is. For example, RLaB  has a built-in command to calculate the sin of an angular quantity - asking RLaB  about it gives the following response

> class( sin )
function

From the size of the list of topics that help is available on, you probably realise that there are many built-in functions in RLaB  - expect gratuitous use of these functions as further examples are given. Remember that you can find out about any function by typing help function-name. We are particularly interested in exploring the use of RLaB  as a computation tool so now we describe further numeric operations.