:- module(_,_).

% Meta-calls: call/n
% ------------------
% - There is also a family of predicates call/1, call/2, 
%   ..., call/n (loaded by package 'hiord')

%   The first argument can be a term including some 
%   of the arguments; the rest of the arguments of the 
%   call should be in the additional arguments of call/n.

q(a,1).
q(b,2).

% Try:
% ?- use_package(hiord).
% ?- P = q, call(P,X,Y).
% ?- P = q(a), call(P,Y).
% ?- P = append, call(P,[1,2],[3,4],Y).
% ?- P = append(X,Y), call(P,[1,2,3,4]).

% - There is also a higher-order library 'hiordlib': 

% Try:
% ?- use_module(library(hiordlib)).
% ?- maplist(plus2, [1,2,3], [4,5,6], R).
% ?- maplist(plus2, [1,2,3], L2, [5,7,9]).
/* 
  ?- maplist(append, [ [a],   X,     X ],  
                     [ [c,d], [e,f], Y ],  
                     [ X,     Y,     Z] ).
*/
