2.10 Compilation
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Overview
        • Compilation
          • During program development
          • For running the result
    • Packages

2.10.1 During program development

During program development, programs are normally loaded using the list abbreviation (?- [load].). It is common practice to organise a project as a collection of source files and a load file, a Prolog file containing only use_module/[1,2] or ensure_loaded/1 directives, possibly with a definition of the entry point of the program, the predicate that is normally used to start the program. This file is often called load.pl. If the entry point is called go, a typical session starts as:

% swipl
<banner>

1 ?- [load].
<compilation messages>
true.

2 ?- go.
<program interaction>

When using Windows, the user may open load.pl from the Windows explorer, which will cause swipl-win.exe to be started in the directory holding load.pl. Prolog loads load.pl before entering the top level. If Prolog is started from an interactive shell, one may choose the type swipl -s load.pl.