Hi, I’ve hit a problem I can’t find my way around…in my “language” I have a predicate for each reserved word, so that I can use call/1, here’s the handling of a built-in function:
render(Options, Term, CodeOut) :- debug(coder, 'C:render: ~w',[Term]), ( functor(Term, F, _), reserved_word(F) -> call(F, Options, Term, CodeOut) ; fncall(Options, Term, CodeOut) ), !.
The problem is, I have a reserved word
include and it’s clashing with
apply:include/3 …I am using
maplist elsewhere and I assumed that was auto-loading apply libraru, I have tried and failed with
:- use_module(library(apply), [maplist/3]).
attempting to only include maplist and I also tried this to not pull in the include
:- use_module(library(apply), except([include/3]).
but neither avoids this:
ERROR: No permission to redefine imported_procedure apply:include/3’`
Here is the code that it won’t chew on:
include(_Opts, _Term, "INCOLUDE TODO").
One way would be to prefix all the handlers with something then use format to create the final name to call/1 but that feels inefficient and ugly.