triska / the-power-of-prolog

Introduction to modern Prolog
https://www.metalevel.at/prolog
1.23k stars 76 forks source link

`attribute_goals/3` existence error while following "Attributed Variables" chapter #35

Open jasonhemann opened 2 years ago

jasonhemann commented 2 years ago

Following the "Attributed Variables" chapter https://www.metalevel.at/prolog/attributedvariables, in a fresh REPL using scryer-prolog version "v0.9.0-63-gc490d818", I constructed a file attrmod.pl, and then attempted to use it at toplevel.

%% File attrmod.pl
:- module(attrmod, []).
:- use_module(library(atts)).
:- attribute a/1.
?- consult('/path/to/attrmod.pl').
   true.
?- attrmod:put_atts(X, a(test)).
caught: error(existence_error(procedure,attribute_goals/3),attribute_goals/3)

I did not expect this behavior. Perhaps a default implementation of attribute_goals in the suggested attrmod.pl file?

triska commented 2 years ago

Thank you, I have filed this as an issue for Scryer Prolog: https://github.com/mthom/scryer-prolog/issues/1432.

triska commented 2 years ago

This is now corrected in Scryer Prolog via https://github.com/mthom/scryer-prolog/commit/ed89c43e484918a045ec7433292772346ca896bc!