next up previous index
Next: SICStus Prolog Compatibility Up: Libraries Previous: Syntax differences

Scattered

 

The ECLiPSe compiler does not allow the clauses for static predicates being non-consecutive, i.e. interleaved with clauses for other predicates. The event 134 "procedure clauses are not consecutive" is raised in such a case. This library provides a means to handle such programs. When compiling from a file, it is enough just to load the library before the compilation. It redefines that handler for the event 134 in such a way that the procedures with non-consecutive procedures are recompiled in one chunk after encountering the end of file.

When not compiling from a file, the non-consecutive clauses have to be declared using the directive scattered/1. This declaration has to precede any clauses of the predicate.

    :- lib(scattered).
    :- scattered p/3, q/1.
Note that this applies to predicates whose clauses are non-consecutive, but in a single file. Predicates that are spread over multiple files still have to be declared as dynamic



Micha Meier
Mon Mar 4 12:11:45 MET 1996