Problem when loading jpl_new/3

Help requests on developing Logtalk applications

Moderator: Paulo Moura

Locked
pedrofmj
Posts: 20
Joined: Sun Jan 18, 2015 1:15 pm

Problem when loading jpl_new/3

Post by pedrofmj »

Hi Dr. Paulo,

I got this error:

[exec] ! error(existence_error(source_sink,jpl),_G2247)
[exec] ! in directive :- use_module(jpl,[jpl_new/3])
[exec] ! in file /home/pedrofmj/Projects/Idea/EgypTeam/Artificial Intelligence/Khalid/khalid-java/dist/settings.lgt between lines 83-84

This is how I import the predicate:

:- use_module(library(jpl)).
:- use_module(jpl, [jpl_new/3]).

Also tryied removing the first one (:- use_module(library(jpl)).):

:- use_module(jpl, [jpl_new/3]).

Any ideas?

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

Re: Problem when loading jpl_new/3

Post by Paulo Moura »

As explained in the documentation:

http://logtalk.org/manuals/refman/direc ... ule_2.html

you use the Logtalk use_module/2 directive:

Code: Select all

:- use_module(jpl, [jpl_new/3]).
inside the entity where you're going to call the module predicate(s). As stated in the documentation, "(...) this directive doesn't automatically load the module.". You must load the module using a Prolog directive. For example, with most (but not all!) backend Prolog compilers:

Code: Select all

:- use_module(library(jpl), []).
as a source file directive, not as an entity directive, e.g. in the entity file or in the application loader file.

Btw, the "jpl" example on the Logtalk distribution illustrates how to do it correctly.
Paulo Moura
Logtalk developer

pedrofmj
Posts: 20
Joined: Sun Jan 18, 2015 1:15 pm

Re: Problem when loading jpl_new/3

Post by pedrofmj »

Dr. Paulo,

Excellent! I put inside the test settings block, and it worked.

Could you please define for the forum what is an Entity? I couldn't understand from the documentation, and it's good for someone who reads this post understand what to do.

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

Re: Problem when loading jpl_new/3

Post by Paulo Moura »

Forums are not a replacement for consulting the documentation. Could you please start checking it before posting? Thanks.

Terms are defined in glossaries. The Logtalk glossary is very easy to locate:

http://logtalk.org/manuals/
Paulo Moura
Logtalk developer

pedrofmj
Posts: 20
Joined: Sun Jan 18, 2015 1:15 pm

Re: Problem when loading jpl_new/3

Post by pedrofmj »

Ok Dr. Paulo.

Sorry, I'm getting familiar with the software, and the website.
I will pay more attention on that., and take a deep look on the documentation.

Thank you,

Pedro.

Locked