Objects referred to in Pop-11 include numbers, words, strings, lists, and others explained later. These are all things that can exist in the Pop-11 virtual machine. There are standard notations in Pop-11 for referring to such things. A few examples are presented here, to introduce ideas used in the following sections. A more comprehensive list is given later in this chapter.
The two most commonly used types of numbers are
o Integers:
E.g. 66, 99876789, -66, 0o Decimals:
E.g. 88.532, 1.2345e3 (= 1234.5), 123.4e-3 (=0.1234), 0.0Other types of numbers are described below. Summary and tutorial information on programming with numbers in Pop-11 can be found in the files: HELP MATH, and TEACH ARITH
E.g. "cat", "ninety", "fast_back", "+**+", "[", ")"
E.g. 'cat', 'ninety', '66', 'a string with spaces ++**@@@@'Words are delimited by double quotes, strings by single quotes. Further differences are described later.
E.g. [a list of words] [ [a list] [of lists] [66 77]]Here is a list containing words, numbers and lists:
[name [joe bloggs] age 33 job [university teacher] sex male]Note that inside a list expression you do not need to use the "quote" marks to refer to a word. Outside a list, if you wish merely to refer to the word, then use the double quote symbols, e.g.:
"elephant"Without the context of quote marks or list or vector expressions, Pop-11 will take a word to refer to its value, assuming that it has been declared as a variable. Sometimes this will produce an error, because the word has no suitable value associated with it.
If matching pairs of square brackets in one of the examples above were replaced by braces, the result could be a vector containing words, numbers and vectors, i.e.
{name {joe bloggs} age 33 job {university teacher} sex male}Lists are more flexible and general. Vectors are more compact. Later the differences between vectors and lists will be explained in more detail.
Pop-11 also provides several other data-types, described later, and allows the user to define new ones. Advanced programmers may find it helpful to look at the online REF DATA file, to get a more complete overview of the types of data in Pop-11 and some information about how they are represented in the machine.