Undefined predicate in Learn Logtalk in Y Minutes

Help requests on developing Logtalk applications

Moderator: Paulo Moura

Post Reply
dram
Posts: 13
Joined: Thu Feb 16, 2017 9:28 am

Undefined predicate in Learn Logtalk in Y Minutes

Post by dram » Tue Feb 21, 2017 9:19 am

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?

dram
Posts: 13
Joined: Thu Feb 16, 2017 9:28 am

Re: Undefined predicate in Learn Logtalk in Y Minutes

Post by dram » Tue Feb 21, 2017 10:09 am

I think I have found the problem:

Code: Select all

:- public(bar).
should be

Code: Select all

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

Paulo Moura
Logtalk developer
Posts: 474
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: Undefined predicate in Learn Logtalk in Y Minutes

Post by Paulo Moura » Tue Feb 21, 2017 11:27 am

Yes, it's a typo in the tutorial. Thanks for reporting. I will submit a fix.
Paulo Moura
Logtalk developer

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest