Search code examples
swi-prologlogtalk

Logtalk - logtalk_load fails


I'm using swi prolog, and just installed logtalk.
When I call logtalk_load with some of the example projects, it always returns false.

% library(win_menu) compiled into win_menu 0.00 sec, 29 clauses
%   C:\Logtalk/configs/swi.pl compiled 0.02 sec, 1,539 clauses
%   C:\Logtalk\users\kikijiki/libpaths/libpaths.pl compiled 0.02 sec, 108 clauses
%   C:\Logtalk/integration/logtalk_comp_swi.pl compiled 0.11 sec, 2,626 clauses
%   c:/logtalk/users/kikijiki/settings.pl compiled 0.00 sec, 3 clauses

Logtalk 2.44.1
Copyright (c) 1998-2012 Paulo Moura

Default lint compilation flags: 
  unknown: warning, misspelt: warning, lgtredef: warning, plredef: silent
  portability: silent, missing_directives: warning
  singletons: warning, underscore_variables: singletons
Default documenting compilation flags:
  xmldocs: on, xmlspec: dtd, xmlsref: local, xslfile: lgtxml.xsl
Default directories compiler flags:
  altdirs: on, tmpdir: lgt_tmp/, xmldir: xml_docs/
Default optional features compiler flags:
  complements: deny, dynamic_declarations: deny
  context_switching_calls: allow, events: deny
Other default compilation flags:
  startup_message: flags, report: on
  code_prefix: $, hook: (none defined)
  optimize: off, source_data: on, debug: on
  clean: on, smart_compilation: off, reload: always
Back-end Prolog compiler and loader flags:
  prolog_compiler: []
  prolog_loader:   []
Read-only compilation flags (back-end Prolog compiler features):
  prolog_dialect: swi, break_predicate: supported, modules: supported
  threads: supported, encoding_directive: full, tabling: unsupported
  coinduction: supported

Loaded settings file found on directory c:/Logtalk/users/kikijiki.

%   C:\Logtalk/configs/swihooks.pl compiled 0.02 sec, 212 clauses
%    library(quintus) compiled into quintus 0.00 sec, 54 clauses
%    library(pce) loaded into pce 0.02 sec, 778 clauses
%   C:\Logtalk/configs/xpcehooks.pl compiled 0.02 sec, 785 clauses
%  c:\Logtalk\integration\logtalk_swi.pl compiled 0.17 sec, 5,302 clauses
% c:/users/kikijiki/appdata/roaming/swi-prolog/pl.ini compiled 0.17 sec, 5,305 clauses
XPCE 6.6.66, July 2009 for Win32: NT,2000,XP
Copyright (C) 1993-2009 University of Amsterdam.
XPCE comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
The host-language is SWI-Prolog version 6.2.6

For HELP on prolog, please type help. or apropos(topic).
         on xpce, please type manpce.

1 ?- logtalk_load('c:/logtalk/examples/people/loader').
% <<< loading source file c:/logtalk/examples/people/loader.lgt... 
% >>> compiling source file c:/logtalk/examples/people/loader.lgt in debug mode...
false.

What am I doing wrong?


Solution

  • Please use the official Logtalk support channels for help in the future. You will get timely replies there.

    Logtalk 2.44.1 doesn't support full or relative (other than a file in the current directory) file paths in the logtalk_compile/1-2 and logtalk_load/1-2 predicates (see the Reference Manual on these predicates). In your case above, to load the "people" programming example, type either:

    ?- logtalk_load(people(loader)).
    

    or:

    ?- {people(loader)}.
    

    This is called (in the Logtalk documentation) "library notation" (and its a notation also found in Prolog). See the "NOTES.txt" and "SCRIPT.txt" in the "examples/people" folder for more details (all examples contains these two files with helpful information).

    Btw, support for relative and full source file paths is available in Logtalk 3.