Linter syntax error: operator_expected

Prolog compatibility woes and feedback that is not compiler specific

Moderator: Paulo Moura

Post Reply
DamienDeville
Posts: 7
Joined: Fri Jan 03, 2020 8:13 pm

Linter syntax error: operator_expected

Post by DamienDeville » Mon Jan 06, 2020 3:59 am

Newb trying to use clpfd in a logtalk program (swi backend) and I get the following Linter error Msg:
REFASModel.lgt:6: ERROR: Syntax error: operator_expected

Here is my object:
1 :- object(metaclass, instantiates(metaclass)).
2 :- use_module(clpfd, [
3 op(760, yfx, #<==>), op(730, yfx, #\), op(720, yfx, #/\),
4 op(700, xfx, #=), op(700, xfx, ins), op(450, xfx, ..),
5 (#<==>/)2, (#/\)/2, (#\)/2, (in)/2, (#=)/2, labeling/2
6 ]).
7 :- uses(list, [append/3, member/2]).
8 :- uses(loop, [foreach/3]).
9 :- public(new/2).
10 new(Instance, Clauses) :- self(Class), create_object(Instance, [instantiates(Class)], [], Clauses).
11 :- end_object.

I fail to catch any difference between my lines 2-6 and the :- use_module(cplfd ... directives in the examples in logtalk3/examples/constraints/swipl/.

What is it that I do not see?

I am using Visual Studio Code with the arthurwang's VSC-Logtalk extension.

Thanks!

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

Re: Linter syntax error: operator_expected

Post by Paulo Moura » Mon Jan 06, 2020 9:15 am

You have a typo in line 5:

Code: Select all

(#<==>/)2
should be:

Code: Select all

(#<==>)/2
Paulo Moura
Logtalk developer

DamienDeville
Posts: 7
Joined: Fri Jan 03, 2020 8:13 pm

Re: Linter syntax error: operator_expected

Post by DamienDeville » Mon Jan 06, 2020 9:39 pm

Oh God! How could I missed that? Thank you very very much!

Post Reply