[Next] [Up] [Previous]
Next: Commands Up: Appendix: Programming in POP-11 Previous: Automated Tourist Guide

Data Objects

The full POP-11 has some 21 different types of data object, but we will be concerned with just four: numbers, words, booleans, and lists. Here are some examples of each type:

Numbers

66 9987679 -66 0 3.14159 -22.55
Numbers may be integers (counting numbers) like 10, 12345, or -66, or they may be decimal numbers like 2.13 or -55.55.
Words

"cat" "ninety" "if" "HI" "hello_there" "MI5"
A POP-11 word consists of a letter followed by a series of letters or numbers and is put between double quote marks. No blank spaces are allowed, so "hello there" is not a legal POP-11 word. The underline symbol _ is taken to be a letter, so "hello_there" is a legal POP-11 word.
Booleans

<true> <false>
There are very many different possible words or numbers, but only two booleans (named after the logician George Boole). We will deal with booleans in chapter 2.
Lists

[The cat sat on the mat] [1 Acacia Avenue]
[name [Joe Bloggs] age 33]
A list is different to the other data objects because it can contain any other type of data object, including other lists. Thus the first example is a list made up of five words: "The" "cat" "sat" "on" "the" "mat" (when a word is inside a list the surrounding quote marks are omitted). The second example is a list comprising a number followed by two words. The third example has four elements: a word "name", a list [Joe Bloggs], a word "age" and a number 33.



Cogsweb Project: luisgh@cogs.susx.ac.uk