Is there a workaround to make ensure_loaded/1 work in GNU Prolog as it works in many other Prolog systems? The goal is to have a preamble so that the rest of code can use ensure_loaded/1 independent of whether which Prolog system I use.
I tried the following:
:- multifile(term_expansion/2).
term_expansion((:- ensure_loaded(X)),
(:- atom_concat('<base>\\', X, Y),
include(Y))).
But the following query doesn't work:
:- ensure_loaded('suite.p').
The path calculation itself is not the issue of the question, but the redefinition of a directive in GNU Prolog. There is another directive that causes problems: meta_predicate/1. The byte code crashes as follows:
Bye