| Did you know ... | Search Documentation: |
| block.pl -- Block: declare suspending predicates |
This module provides SICStus Prolog-compatible :- block BlockSpec,
... declarations for delaying predicate calls if certain arguments are
unbound.
block +Headstrue. A
blockspec evaluated to true iff all arguments specified as `-' are
unbound.
Multiple BlockSpecs for a single predicate can appear in one or more
:- block declarations. The predicate is suspended untill all mode
patterns that apply to it are satisfied.
The implementation is realised by creating a wrapper that checks the block conditions and either calls the original predicate immediately (if none of the block conditions were true) or uses attributed variables to delay re-evaluating the block condition until any of the arguments in question are bound.