next up previous contents
Next: Non-destructive assignment "->>" Up: CHAPTER.3: PROCEDURES AND Previous: updatersthe stack

Defining updaters

Any Pop-11 procedure is allowed to have an updater associated with it, whether it is concerned with accessing datastructures or not. Equally, it is not essential for an updater procedure to take something from the stack. For sophisticated programmers this is often a powerful tool, which allows related pairs of procedures to be closely associated, and used, for example, in connection with Pop-11's "dynamic local expression" mechanism, introduced in HELP DLOCAL.

The syntax for defining the updater of a procedure is of the form:

    define updaterof ....
which is illustrated in HELP DEFINE, and discussed in a later chapter.

By default a newly created procedure is given an updater that does nothing except produce an error message, like this:

    66 -> sqrt(4) =>
    ;;; INVOLVING:  <procedure sqrt>
HELP UPDATER gives more information. Experts can look at REF PROCEDURE.

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