Page 1 of 1

Undefined predicate in Learn Logtalk in Y Minutes

Posted: Tue Feb 21, 2017 9:19 am
by dram
In Learn Logtalk in Y Minutes, there is an example for undefined predicate, which load successfully according to the tutorial content. But I failed to load in swilgt (SWI 7.3.35 and Logtalk 3.9.3-rc1). Following are detailed error message:

Code: Select all

1 ?- {foo}.
!     Type error: expected predicate_indicator but got bar
!       in directive :- public bar
!       in file /home/dram/logtalk/learnxinyminutes/foo.lgt at or above line 3
false.
Not sure which is incorrect, implementation or tutorial?

Re: Undefined predicate in Learn Logtalk in Y Minutes

Posted: Tue Feb 21, 2017 10:09 am
by dram
I think I have found the problem:

Code: Select all

:- public(bar).
should be

Code: Select all

:- public(bar/0).
Is that the point?

Re: Undefined predicate in Learn Logtalk in Y Minutes

Posted: Tue Feb 21, 2017 11:27 am
by Paulo Moura
Yes, it's a typo in the tutorial. Thanks for reporting. I will submit a fix.