I am trying to use list constructor in SWI-Prolog, but am getting \'dict\' expected error.
For example,
.(a, []) == [a].
ERROR: Type error: `dict\
Better to use | in conventional notation,
?- X = '[|]'(1,[0]).
X = [1, 0].
can be write like this
?- X = [1|[0]].
X = [1, 0].
SWI-Prolog 7.x uses a different list constructor, '[|]'/2, instead of the traditional ./2 Prolog constructor:
?- '[|]'(1,[]) == [1].
true.
The change was motivated to free ./2 for other uses, notably in dict terms, as hinted in the error message you got for your query.