How do I include a .pl file in Prolog?

If your file is called foo.pl, you can include it using

:- [foo].

or, equivalently and a bit more explicit

:- consult(foo).

or, if you’re worried it may be loaded several times in a larger app

:- ensure_loaded(foo).

or, if you’re using full-blown modules

:- use_module(foo).

though the exact name of the last predicate differs between Prolog versions.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)