diff --git a/t/apply.pl b/t/apply.pl index d35b3f7..dcf97de 100644 --- a/t/apply.pl +++ b/t/apply.pl @@ -45,6 +45,10 @@ use_module(here(resources/foo)), %% see dummy file resources/foo.pl foo:bar(a). +tilde_in_meta_predicate :- + findall(X, (Y = 1, X = succ(Y, ~)), Xs), + Xs == [2]. + dicts :- John = person{ name: "John", age: 27 }, "John" == John $ name, @@ -53,3 +57,26 @@ 'dict missing a key'(fail) :- Point = point{x:2, y:3}, writeln(Point $ z). % looking up z fails + + +%% meta calls +succ(succ(call(succ, succ(1, ~), ~), ~), 5). + +append(append([a], [b], ~), [c], [a,b,c]). + +findall(X, (member(Y, [1,2]), X is 2 * succ(Y, ~)), [4, 6]). + +bagof(fixme('fails because of ^ meta arg spec is not supported')) :- + bagof(X, (member(Y, [1,2]), X is 2 * succ(Y, ~)), [4, 6]). + + +maplist_example :- maplist([X, Y]>>append(X, append([a], [b], ~), Y), + [[c], [d]], + [[c, a, b], + [d, a, b]]). + + + + + +