This manual draws an intuitive but ultimately artificial distinction between "data types" like integer, which the programmer tends to think of as atomic entities, and objects, which the programmer tends to think of as named collections of atomic entities. This chapter briefly introduces the former.
Muq is intended to ultimately support a good implementation of CommonLisp, hence the data types are closely related to those implemented by CommonLisp. Any serious differences between Muq and CommonLisp data types are likely to eventually be resolved in Common Lisp's favor.
Note that in muf, like Lisp but unlike C, it is values which have types, not variables. It is perfectly legal, and frequently useful, for a muf variable to hold an integer one moment and a string or object the next. Since all values "know" what type they are, no confusion results.
(In languages like C, on the other hand, values do not "know" what type they are, so allowing the same variable to hold an integer at one moment and a float at the next is normally an excellent recipe for disaster.)
With only obscure server-internal exceptions, all Muq data types are first class: any of them may be stored in any variable, pushed on any stack, used as a key or value on any object, and so forth (1). This makes for a more flexible and predictable system than in traditional mudservers, in which each class of variable or property has arbitrary (and different) restrictions on which values may be stored, few if any of them designed to make the muf programmer's life easier. (Many individual Muq operators accept only arguments of certain kinds, of course: arithmetic operators expect numbers, string formatting operators expect strings, and so on. This is a separate issue.)
Go to the first, previous, next, last section, table of contents.