On 11/01/2017 02:17 AM, 'Anne Ogborn' via SWI-Prolog wrote:
> I have a predicate,
>
> json_item/3
>
> whose last argument is an options list (I'm not using the library 'options' definitions,
> though I'm using option/2 so it's autoloading)
>
> for convenience I'm making another public predicate, json_item/2, which does the obvious and usual
>
> json_item(Term, JSON) :-
> json_item(Term, JSON, []).
>
> Which produces this cryptic compile time error
>
> ERROR: [Thread pce] /usr/local/simularity/library/agent.pl:160:30: Type error: `callable' expected, found `[]' (an empty_list)
>
>
> Changing it to:
>
> json_item(Term, JSON) :-
> length(L, 0), % I have *NO* idea why this is necessary!
> json_item(Term, JSON, L).
>
>
>
> fools the compiler, and life is good.
>
> json_item is not defined as a meta_predicate
>
> I've looked at the term_expansions, I've looked for it in the SWI libs.
Quite likely something must somehow think this is a meta-argument. You
could try predicate_property/2 on it to check. Also, this originates
from the `pce` thread. Is this due to a compile command issued from the
editor or could it have to do with syntax highlighting?
Anyway, this is hard to tell without being able to reproduce. Contact
me if you can share (enough of) the code with me.
> I'm on 7.7.0
>
> Advice on debugging would be appreciated. I assume I've borked something
>
> ::Annie is here, making Jan bang his head on his desk in frustration yet again::
:)
Cheers --- Jan