Re: predutils package available (Re: PAC library for develop version available)
"Richard A. O'Keefe" <[email protected]> Fri, 3 Oct 2014 16:24:56 +1300
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
'use_module' comes from Quintus Prolog.
The way it was intended to be used was
:- use_module(Module_Name, [
Imported_Predicate_1/Arity_1,
...,
Imported_Predicate_n/Arity_n
]).
It was considered to be important for software maintenance
that you should explicitly list all the predicates you
needed from the module. Having done this, the imported
predicates are then available *without* requiring any prefix.
This is like the way you do
from fractions import Fraction
in Python, after which you use fractions.Fraction as just
plain Fraction.
This is dual to the way that a :- module directive lists
all the things *exported* from a module.
The idea was that *all* the stuff relating to modules
(:- module, :- use_module, :- meta_predicate) should be
at the very top of a file, and the rest of the file
should as much as possible look as though modules did
not exist.