[ The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

# library(scattered)

Allow a source file to contain non-consecutive clauses

## Predicates

> abort_compile_file(?, ?, ?)
>   No description available
> end_compile_file(?, ?, ?)
>   No description available
> non_consecutive_handler(?, ?, ?)
>   No description available
> scattered(++PredSpec)
>   This declaration is obsolete, use discontiguous/1 instead.
> start_compile_file(?, ?, ?)
>   No description available

## Other Exports

> export op(1000, fy, scattered)

## Description

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. The correct way to avoid this error is to use the discontiguous/1 declaration (ISO-Prolog compatible).

This library is therefore mostly obsolete!

It can still be useful for very old Prolog programs, which have been written for an interpreted system, and expect non-consecutive predicates to be generally allowed (without declaration). It is enough to load this library before compiling such a source file. It redefines the handler for the event 134 in such a way that the procedures with non-consecutive clauses are recompiled in one chunk after encountering the end of the 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.

## About

- Status: deprecated
- Author: Joachim Schimpf and Micha Meier, ECRC Munich
- Copyright © Cisco Systems, Inc
- Date: $Date: 2006/09/23 01:55:33 $

Generated from scattered.eci on Sat Nov 8 06:57:03 2008