My pack pac was aimed at clojure in Prolog. The latest version is 1.7.4. I have noticed that functional syntax of the pac works also on toplevel query on terminal, though I don’t understand well why it works. Usually I use it while editing on Emacs (ediprolog.el). I hope you could reproduce the sample queries below on terminal. Unfortunately I could post only sample queries for now, without boring explanations.
At terminal
% swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.16-37-ga0900ca3d)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- use_module(library(pac)).
true.
?- module(pac).
true.
pac: ?- append([1,2])@[3,4]@V.
V = [1, 2, 3, 4].
pac: ?- append@X@Y@[1,2,3].
X = [],
Y = [1, 2, 3] ;
X = [1],
Y = [2, 3] ;
X = [1, 2],
Y = [3] ;
X = [1, 2, 3],
Y = [] ;
false.
pac: ?- flip(is)@(1+2)@V.
V = 3.
pac: ?- eval@(append@[1,2]@[3,4])@X.
X = append([1, 2], [3, 4]).
pac: ?- eval@(:append@[1,2]@[3,4])@X.
X = [1, 2, 3, 4].
pac: ?- eval(:append@[1,2]@[3,4], X).
X = [1, 2, 3, 4].
pac: ?- call(append@[1,2]@[3,4]@X).
X = [1, 2, 3, 4].
pac: ?- call@(append@[1,2]@[3,4]@X).
X = [1, 2, 3, 4].
pac: ?- #(:flip@flip(is))@X@(1+2).
X = 3.
Emacs (ediprolog.el)
% ?- append@X@Y@[a,b].
%@ X = [],
%@ Y = [a, b] ;
%@ X = [a],
%@ Y = [b] ;
%@ X = [a, b],
%@ Y = [] ;
%@ false.
% ?- (=)@X@2.
%@ X = 2.
% ?- =(X)@2.
%@ X = 2.
% ?- flip(is)@(1+2+3)@X.
%@ X = 6.
% ?- eval(:flip(is)@(1+2+3), V).
%@ V = 6.
% ?- eval@(:flip(is)@(1+2+3))@V.
%@ V = 6.
% ?- #(:flip@(:flip@(flip(is))))@(1+2+3)@F.
%@ F = 6.
% ?- #(:flip@(flip(is)))@V@(1+2+3).
%@ V = 6.
% ?- #(:flip@(:flip@is))@V@(1+2+3).
%@ V = 6.
% ?- call(flip(is)@(1+2+3)@V).
%@ V = 6.
% ?- call@(flip(is)@(1+2+3)@V).
%@ V = 6.
% ?- flip(is)@(1+2+3)@V.
% ?- call(flip(is), (1+2+3), V).
%@ V = 6.
% ?- call(flip(is) @ (1+2+3), V).
%@ V = 6.
% ?- #(call @ flip(is) @ (1+2+3)) @ V.
%@ V = 6.
% ?- permutation([1,2,3], P), show(flip(P, append)), fail.
%@ pac:pac#54, where
%@ pac:pac#54(A,B,C):-pac:append(A,B,C)
%@ pac:pac#55, where
%@ pac:pac#55(A,B,C):-pac:append(A,C,B)
%@ pac:pac#56, where
%@ pac:pac#56(A,B,C):-pac:append(B,A,C)
%@ pac:pac#57, where
%@ pac:pac#57(A,B,C):-pac:append(B,C,A)
%@ pac:pac#58, where
%@ pac:pac#58(A,B,C):-pac:append(C,A,B)
%@ pac:pac#59, where
%@ pac:pac#59(A,B,C):-pac:append(C,B,A)
%@ false.