do-retrieve [Macro]


Purpose

The do-retrieve macro executes a body of Lisp code once for each instance or tuple retrieved by a given query.

Syntax

do-retrieve variables query &body body

Arguments

The variables argument is a symbol, or list of symbols, each beginning with the character ?.

The query argument is an arbitrary Loom query expression (see retrieve Remarks).

The body argument is the Lisp code to be executed for each binding of variables.

Value

This function returns nil.

Examples

(do-retrieve (?p ?a) 
    (:and (Person ?p) (age ?p ?a)) 
    (tellm (age ?p (+ ?a 1))))

See Also

Last modified: Jun 1 1995