next up previous contents
Next: Procedures associated with Up: CHAPTER.2: INTRODUCTION TO Previous: Revision questions

Built in Pop-11 data types

We have seen that a programming language allows you to construct expressions which denote objects, and we have seen some examples of Pop-11 expressions. Programming languages differ in the range of types of objects they can refer to. Often there is a fixed set of "data types" built in to the language, e.g. numbers, words and lists.

Some languages, including Pop-11, allow you to extend the set of data types indefinitely. In Pop-11 this requires using the procedure CONSKEY, or the DEFCLASS declaration (which is the basis for the RECORDCLASS and VECTORCLASS declarations), which will be explained in a later section. The OBJECTCLASS facility, based on these, allows still further extension by permitting the user to define overlapping hierarchies of types of objects with associated families of "methods" for operating on them. (This is probably the most important feature of what is known as Object Oriented Programming.)

For now we shall concentrate only on the built-in data-types, which provide the basis of all other data-types. Most types of objects are associated with special data-structures called "keys". For instance, the key known as integer_key is associated with integers, and the key known as string_key is associated with strings. The key associated with a particular type of data is another data-structure of type "key" which contains information about the type, including how to print it, which procedures are provided for manipulating its contents (if it has accessible contents), and so on.

Some data-types do not have keys because they are built-up from more primitive data-types. For example there is not a list_key because lists are built up from chains of pairs, so that the pair_key suffices.



Aaron Sloman
Fri Jan 2 03:17:44 GMT 1998