next up previous
Next: 7.4 List Structure Operators Up: 7. LIST STRUCTURES Previous: 7.2 Construction of List

7.3 Property Lists

In other sections, atomic symbols have been considered only as pointers. In this section the property lists of atomic symbols that begin at the appointed locations are described.

Every atomic symbol has a property list. When an atomic symbol is read in for the first time, a property list is created for it.

A property list is characterized by having the special constant $77777_{8}$ (i.e., minus 1) as the first element of the list. The rest of the list contains various properties of the atomic symbol. Each property is preceded by an atomic symbol which is called its indicator. Some of the indicators are:

PNAME - the BCD print name of the atomic symbol for input-output use.
EXPR - S-expression defining a function whose name is the atomic symbol on whose property list the EXPR appears.
SUBR - Function defined by a machine language subroutine.
APVAL - Permanent value for the atomic symbol considered as a variable.

The atomic symbol NIL has two things on its property list - its PNAME, and an APVAL that gives it a value of NIL. Its property list looks like this:

.---.---.  .-----.---.  .---.---.  .-----.---.  .---.---.
|-1 |   |->|APVAL|   |->|   |   |->|PNAME|***|->|   |***|
`---'---'  `-----'---'  `---'---'  `-----'---'  `---'---'
  ^                       |                       |
  |                     .-V-.---.               .-V-.---.
  |                     |   |***|               |   |***|
  |                     `---'---'               `---'---'
  |                       |                       |
  '-----------------------'                     .-V-----.
                                                | NUL???|
                                                `-------'

The print name (PNAME) is depressed two levels to allow for names of more than six BCD characters. The last word of the print name is filled out with the illegal BCD character $77_{8}$ (?). The print name of EXAMPLE would look like this:

      .-----.---.  .---.---.
- - ->|PNAME|   |->|   |   |-> - - -
      `-----'---'  `---'---'
                     |
                     |   .---.---.   .---.---.
                     `-->|   |   |-->|   |***|
                         `---'---'   `---'---'
                           |           |
                         .-V-----.   .-V-----.
                         |EXAMPL |   |E????? |
                         `-------'   `-------'

The property list of a machine-language function contains the indicator SUBR followed by a TXL instruction giving the location of the subroutine and the number of arguments. For example

              .----.---.  .---.---.
        - - ->|SUBR|   |->|   |   |-> - - -
              `----'---'  `---'---'
                            |
                            |   .-------------.
                            `-->|TXL 37721,,2 |
                                `-------------'

The indicator EXPR points to an S-expression defining a function. The function define puts EXPR's on property lists. After defining ff, its property list would look like this

.---.---.  .-----.---.  .---.---.  .-----.---.  .---.---.
|-1 |   |->|EXPR |   |->|   |   |->|PNAME|***|->|   |***|
`---'---'  `-----'---'  `---'---'  `-----'---'  `---'---'
  .-----------------------'                       |
.-V----.---.  .---.---.  .---.---.               .-V-.---.
|LAMBDA|   |->|   |   |->|   |***|               |   |***|
`------'---'  `---'---'  `---'---'               `---'---'
                |          |                      |
              .---.---.  .----.---.             .-V-----.
              | X |***|  |COND|   |-> - -       | FF????|
              `---'---'  `----'---'             `-------'

The function get[x;i] can be used to find a property of x whose indicator is i. The value of get[FF,EXPR] would be (LAMBDA (X) (COND ...

A property with its indicator can be removed by remprop[x,i].

The function deflist[x,i] can be used to put any indicator on a property list. The first argument is a list of pairs as for define, the second argument is the indicator to be used. defme[x] = deflist[x;EXPR].

An indicator on a property list that does not have a property following it is called a flag. For example, the flag TRACE is a signal that a function is to be traced. Flags can be put on property lists and removed by using the pseudo-functions flag and remflag.

Numbers are represented by a type of atomic symbol in LISP. This word consists of a word with -1 in the address, certain bits in the tag which specify that it is a number and what type it is, and a pointer to the number itself in the decrement of this word.

Unlike atomic symbols, numbers are not stored uniquely.

For example, the decimal number 15 is represented as follows:

      .----.---.---.  .--------------.
      | -1 | 1 |   |->| 000000000017 |
      `----'---'---'  `--------------'


next up previous
Next: 7.4 List Structure Operators Up: 7. LIST STRUCTURES Previous: 7.2 Construction of List