fferri
fferri

Reputation: 18940

From a module, consult a file in another module

For some reason, in my Prolog module I want to be able to consult a file, but like if it was consulted from another module (e.g. user).

Say I have a file named myfile.pl containing:

foo(1).

Normally, if in module mymodule I execute consult(myfile), what I have is a new predicate mymodule:foo/1.

I would like to be able to consult the file from module mymodule but the resulting predicate be like user:foo/1.

Is this possible?

Upvotes: 0

Views: 96

Answers (1)

Paulo Moura
Paulo Moura

Reputation: 18663

Did you tried to call consult(user:myfile) from within your mymodule module?

Upvotes: 1

Related Questions