problem integrating Logtalk in JIProlog

Tips and tricks when running Logtalk using JIProlog as the back-end compiler

Moderator: Paulo Moura

Post Reply
Monikuta
Posts: 13
Joined: Mon May 12, 2008 9:02 am

problem integrating Logtalk in JIProlog

Post by Monikuta » Mon May 12, 2008 12:50 pm

I want to use the object-oriented feature of Logtalk and therefore i am trying to integrate it into JIProlog v3.0.3-1.
Logtalk should work with JIProlog starting from v3.0.2-6.
I am doing the following:

1. starting JIProlog IDE
2. loading ji.config from the Logtalk\configs
3. loading logtalk.pl (compiler and runtime files) from Logtalk\compiler
4. loading libpaths.pl (library paths configuration file) from the
Logtalk\libpaths.

Afterwards, i try to run a simple Logtalk example from JIProlog:
1. i change the current working directory to ....\hello_world\
cd('C:\\Users\\Monikuta\\Documents\\Logtalk_workspace\\examples\\hello_world\\').

2. and i compile the hello_world.lgt program by logtalk_compile(hello_world).

...and it crashes :

Code: Select all

JIP:- logtalk_compile(hello_world)
>>> compiling source file hello_world...
compiling object hello_world... 
ERROR! entity_ending_directive_missing(object, hello_world)

error(entity_ending_directive_missing(object, hello_world), logtalk_compile(hello_world))
User Exception
Stack Trace? (y/n)y
xcall(com.ugos.JIProlog.extensions.exception.JIPCatch3, [logtalk_compile(hello_world, []), error(entity_ending_directive_missing(object, hello_world), logtalk_compile(hello_world, [])), throw(error(entity_ending_directive_missing(object, hello_world), logtalk_compile(hello_world)))])
- catch(logtalk_compile(hello_world, []), error(entity_ending_directive_missing(object, hello_world), logtalk_compile(hello_world, [])), throw(error(entity_ending_directive_missing(object, hello_world), logtalk_compile(hello_world))))
- logtalk_compile(hello_world)
....i thought the error had something to do with the fact that some modifications i don't know about needed to be done in Logtalk libpaths.pl or some other file.

"Logtalk runs with little or no modifications with the following back-end Prolog compilers (in alphabetical order): * ALS Prolog 3.1 * Amzi! Prolog 7.6.1 * BinProlog 8.x~10.x * B-Prolog 7.0 * CIAO Prolog 1.10p5 * CxProlog 0.96.1 * ECLiPSe 5.10#26 * IF/Prolog 5.x * JIProlog 3.0.2-8",

but the following simple program (without any objects defined) compiles just fine with the logtalk_compile directive:
printme.lgt:

Code: Select all

printingMe :- write('heeeeeeeeeeeeeeeeeeeeeelp').

JIP :- logtalk_compile(printme).
JIP :- logtalk_load(printme).
JIP :- printingMe.
I would be sincerely greatful if you could help me solve this error.

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

Re: problem integrating Logtalk in JIProlog

Post by Paulo Moura » Mon May 12, 2008 3:26 pm

Monikuta wrote: 4. loading libpaths.pl (library paths configuration file) from the
Logtalk\libpaths.
...
....i thought the error had something to do with the fact that some modifications i don't know about needed to be done in Logtalk libpaths.pl or some other file.
JIProlog does not support expansion of environment variables on atoms representing file paths. You need to edit the libpaths/libpaths.pl file and replace (at line 12) the occurrence of the environment variable LOGTALKUSER by the actual path to your Logtalk user folder. This issue, however, does not explain the error that you're getting trying to load the Logtalk "hello_world" example. I'm able to reproduce the problem. I'm tracing execution to try to locate the problem. More later.

Cheers,

Paulo
Paulo Moura
Logtalk developer

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

Re: problem integrating Logtalk in JIProlog

Post by Paulo Moura » Mon May 12, 2008 3:48 pm

Hi!

I've found a bug in the JIProlog implementation of the standard read_term/3 predicate that explains the problem you reported. I'm waiting for a reply from the JIProlog author to my bug report. Thanks for bringing this problem to our attention.

Best regards,

Paulo
Paulo Moura
Logtalk developer

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

Re: problem integrating Logtalk in JIProlog

Post by Paulo Moura » Fri May 16, 2008 9:15 am

Hi!

I found another JIProlog bug in the implementation of the standard predicate open/3: opening a file for writing appends to the file if it already exists instead of overwriting it. Both this bug and the bug in read_term/3 described in my previous post have been already fixed by the JIProlog author. A new JIProlog release is expected soon including these bug fixes.

Best regards,

Paulo
Paulo Moura
Logtalk developer

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest