Data Types

EEL supports a rich set of data types. First there are the
basic types:

int

These are 32 bit signed quantities. These correspond to
integers. The value of an int ranges from -2,147,483,648 to
2,147,483,647.

short

These are like ints, except they are only 16 bits. Thus
the value ranges from -32768 to 32767.

char

These are 16 bit unsigned quantities. They
correspond to characters. For example, the buffer primitive
curchar( ) returns an object of type char. The values range from
0 to 65535.

byte

These are 8 bit unsigned quantities.

spot

These are references to buffer positions. A
spot can remember a buffer position in such a way that after
inserting or deleting characters in the buffer, the spot will still
be between the same two characters. Like pointers, spots can also
hold the special value zero. See Spots.

Besides basic types, there is an infinite set of types derived
from these. They are defined recursively as follows:

pointer

If t is some type, then
pointer to t is also a type. Conceptually, this is the address
of some object of type t. When you dereference an object of type
pointer to t, the result is of type t.

array

If t is some type, then array of t is also a type.

structure

If t1, ... , tn are types, then
structure oft1, ... , tn is also a type.
Conceptually, a structure is a sequence of objects, where the jth
object is of type tj.

union

If t1, ... , tn are types, then
union oft1, ... , tn is also a type.
Conceptually, a union is an object that can be of any of type
t1, ... , tn at different times.

function

If t is a type, then function returning t is
also a type.

Any function has a type, which is the type of the value it returns.
If the function returns no value, it is of int type, but it is
illegal to attempt to use the function's value.

Regardless of its type,
you may declare any function to be a command (using the
command keyword) if it takes no
parameters. Commands like named-command on Alt-X will then
complete on its name, but there is no other difference between
commands and subroutines (user-defined functions which are not
commands). Functions that the user is expected to invoke directly
(by pressing a key, for example) are generally commands, while
functions that act as helpers to commands are generally subroutines.
Nothing prevents an EEL function from calling a command directly,
though, and the user can invoke any subroutine directly as well
(providing that it takes no arguments). Though a command may not
have arguments, it may return a value (which is ignored when the user
directly invokes it).