Re: Global predicates in SWI and Sicstus Prolog

From: Bart Demoen (bmd_at_cs.kuleuven.ac.be)
Date: 08/23/04


Date: Mon, 23 Aug 2004 11:40:47 +0200


> 2. Sicstus Prolog
[...]
> So, how can I make bar/1 visible within the "test" module?
> use_module(user) can't be the solution (it prompts for user input).
> The order in which I consult the files does not make a difference.

There might be more than one way to do it, and maybe better than what I
suggest, but putting in file1.pl the directive

:- use_module('file2.pl',[bar/1]).

seems to do what you want.

Cheers

Bart Demoen

ps. look in the SICStus manual - it took me about 1 minute to come up
with the above - I didn't know this beforehand