Error reading a list in JIProlog

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

Moderator: Paulo Moura

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

Error reading a list in JIProlog

Post by Monikuta »

For my Checkers game, I am using a class Board that has two lists:
-one for the computer player's pieces
-one for the human player's pieces

I have tried my code in SWI-Prolog with Logtalk and it works just fine.
But, when switching to JIProlog with Logtalk I get an error when trying to read a list from input.
I am reading the human player's move from console, under the form of a list.

The error I receive is the following:

Code: Select all

error(syntax_error('operator_expected([])'), file(user, 1))
Syntax Error - File: user, Line: 1, Cause: operator_expected([])
I also tried making a file with a single predicate, "appendL", without using Logtalk objects:

Code: Select all

appendL :- write('List '),
                         append(L,[3,4], R),
                         write('New '),
But I receive the same error :(

In SWI-Prolog and Logtalk it works ok. Can you please help me solve this problem?
Yours sincerely,
Monica Dogaru

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

Re: Error reading a list in JIProlog

Post by Paulo Moura »

Hi Monica!

The problem you describe is a JIProlog specific problem, unrelated to Logtalk. I suggest that you contact Ugo Chirico, JIProlog author.

Best regards,

Paulo Moura
Logtalk developer