scryer-prolog: Missing standard predicates

With the current git version:

?- callable(foo).
caught: error(existence_error(procedure,callable/1),callable/1)
?- retractall(foo).
caught: error(existence_error(procedure,retractall/1),retractall/1)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve added the missing predicates.

Indeed by using the following tester.lgt driver file with Scryer Prolog:

:- initialization((
	set_logtalk_flag(report, warnings),
	set_logtalk_flag(unknown_entities, silent),
	logtalk_load(lgtunit(loader)),
	logtalk_load(tests, [hook(lgtunit)]),
	tests::run
)).

we get with your code above:

?- {tester}.
Warning: singleton variables User, Password, Host, Port, Database, Stream at line 2 of postgresql.pl
Warning: singleton variables User, Password, Host, Port, Database, Stream at line 2 of postgresql.pl
% 
% tests started at 2021-09-24, 09:44:36
% 
% running tests from object tests
% file: /Users/pmoura/aarroyoc/tests.lgt
% 
% password_connection_ok: success (in 0.0 seconds)
% 
% 1 tests: 0 skipped, 1 passed, 0 failed (0 flaky)
% completed tests from object tests
% 
% no code coverage information collected
% tests ended at 2021-09-24, 09:44:36
% 
   true
;  ...
?- 

Of course, the proper fix is to implement the missing current_module/1 predicate in Scryer Prolog.

current_module/1 seems to be required to execute lgtUnit on Scryer right?

No. Please see https://github.com/mthom/scryer-prolog/discussions/966 for instructions on how to run Logtalk and lgtunit.

The prolog_load_context/2 is expected to succeed only during source file loading while current_module/1 can be called at any time.