Page 1 of 1

Linter syntax error: operator_expected

Posted: Mon Jan 06, 2020 3:59 am
by DamienDeville
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!

Re: Linter syntax error: operator_expected

Posted: Mon Jan 06, 2020 9:15 am
by Paulo Moura
You have a typo in line 5:

Code: Select all

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

Code: Select all

(#<==>)/2

Re: Linter syntax error: operator_expected

Posted: Mon Jan 06, 2020 9:39 pm
by DamienDeville
Oh God! How could I missed that? Thank you very very much!