next up previous contents
Next: Using LOOKUP to Up: CHAPTER.7: THE POP-11 Previous: Using "it" to

Retrieving values from within a matching ITEM

Since all of the apparatus of MATCHES is utilised in those DATABASE procedures, PRESENT can be used to set values of appropriately queried variables in the pattern specification.

    vars x;
    present([?x b ==]) =>
    ** <true>
    x =>
    ** a
    it =>
Notice that if "?" or "??" is used before a word in a pattern, then that word should be declared as a variable name. Hence the "vars x;" above.

If the variables in patterns are not declared to be local, to the procedures which use them, then different procedures can mess each other up. This applies to procedures which use MATCHES or any of the database operations PRESENT, FLUSH, LOOKUP, REMOVE, etc.



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