mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
2.07k stars 125 forks source link

Loading multiple files from the REPL #714

Open mb64 opened 4 years ago

mb64 commented 4 years ago

I'm not sure what (if anything) the ISO standard dictates, but in GNU Prolog and partially in SWI Prolog, one can consult multiple files as [a, b]. instead of [a]. [b]. in the REPL.

In Scryer, it seems to be interpreted as a list of goals:

$ scryer-prolog 
?- [write('Hello, world!'), nl].
Hello, world!
   true.
?- 
UWN commented 4 years ago

'.'/2 is not ISO. The precise meaning of it varies a lot between systems.

The cleanest way instead is to use the module system. And file inclusion and ensure loaded directives.