Datatypes

There are five datatypes in COOL: string (STR), number (NUM), object
(OBJ), list (LIST), and error (ERR).

No type checking is done by COOL at compile-time.  At run-time, if a
type mismatch occurs in an operator or system function, E_TYPE is
raised.

String (STR)
------------

Strings are enclosed in doublequotes (").
The following are examples of string constants:

	"foo"
	"The rain in spain.\n"
	"They call me \"The Woodmaster\", son."

String variables are declared as follows:

	
Number (NUM)
------------

Numbers are long integers (typically in the range -2^31 to 2^31 - 1).

Object ID (OBJ)
---------------

Object ID's consist of two parts:  the ID, and the servername.
The following are values of type OBJ:

	#5@joemud
	#10@fredmud

If the object in question is on the local MUD, the server part may
be omitted:

	#7		

represents object #7 on the local MUD.  The value #-1 is a special
value, usually meaning 'nothing' or some kind of error condition.

List (LIST)
-----------

Lists are heterogenous, ordered collections of other datatypes.
They can be manipulated as unordered sets, using the set_add() and
set_remove() functions, or as ordered lists, using list_insert(),
list_append(), list_assign().  and list_delete().

Typically lists are used to store things like the contents of a
room (a list of OBJ), or a list of methods on an object (a list
of STR).

The elements of a list are enclosed by braces, and separated by commas.
The following are examples of lists:

	{}				(the empty list)
	{1, 2, 3}
	{"abc", "def", "ghi"}
	{ {1, 2}, {3, 4}, {5, 6} }	(a list of lists)
	{1, "abc", #3}			(a heterogenous list)

Error (ERR)
-----------

Error values store the result of an operation.  The following is a list
of the current errors and their meanings:

    E_TYPE		Type mismatch
    E_RANGE		Range error
    E_INVIND		Invalid indirection
    E_DIV		Division by zero
    E_MAXREC		Maximum recursion exceeded
    E_METHODNF		Method not found
    E_VARNF		Variable not found
    E_FOR		For variable not a list
    E_SERVERNF		Server not found
    E_SERVERDN		Server down
    E_OBJNF		Object not found
    E_MESSAGE		Message unparseable
    E_TIMEOUT		Timed out
    E_STACKOVR		Stack overflow
    E_STACKUND		Stack underflow
    E_PERM		Permission denied
    E_INTERNAL		Internal error