I have this arbitrary function that I need to call many times with different variables. By the way, this is SWI-Prolog
perform(V1,V2,V3,Function,Result):- % % do little stuf. % Function(Arg1,Arg2,Result).
This gives a syntax error.
But passing the function as a variable without adding arguments works fine, as in the following code:
perform(Function):- Function. sayHello:- write('hello'). :-perform(sayHello).
So how to add arguments to a variable?
source share