scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

ISO core `ensure_loaded/1` directive is not recognized

Open rotu opened this issue 8 months ago • 1 comments

Using the ensure_loaded/1 directive in Prolog text results in an error at load time:

e.g.

$ cat .\scratch.pl
:- ensure_loaded(some_file).
$ scryer-prolog.exe .\scratch.pl
   error(domain_error(directive,ensure_loaded/1),load/1).

This directive is defined in ISO/IEC 13211-1:

7.4.2.8 ensure_loaded/1

A directive ensure_loaded(P_text) specifies that the Prolog text being prepared for execution shall include the Prolog text denoted by P_text where P_text is an implementation defined ground term designating a Prolog text unit

When multiple directives ensure_loaded(P_text) exist for the same Prolog text, that Prolog text is included in the Prolog text prepared for execution only once. The position where it is included is implementation defined.

rotu avatar May 13 '25 18:05 rotu

Related: #634.

triska avatar May 13 '25 20:05 triska