summaryrefslogtreecommitdiff
path: root/example.pl
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-06-30 17:03:25 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-06-30 17:03:25 +0000
commit50f83a91220940042962fdb55d07bb03991f52be (patch)
treec2d1046393d7c3f75becd7b2150afab46156baf0 /example.pl
parent347e5bc533070a5e988d82e7588a4e905c7096f3 (diff)
Add support for builtins, and implement true/0, fail/0, call/1, and !/0 builtins
Diffstat (limited to 'example.pl')
-rw-r--r--example.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/example.pl b/example.pl
index d9ffc2a..3df943c 100644
--- a/example.pl
+++ b/example.pl
@@ -5,8 +5,6 @@ parentest :-
parentest :-
(0 * (1 + 2) * 3) * 3 + 4.
-true.
-
likes(bob, ice).
likes(sam, text).
likes(sam, ice).
@@ -21,6 +19,9 @@ list2(A) :- A = [a,b|c].
curly(A) :- A = {one,two,three}.
+tester(A, B) :- !, A = B.
+tester(A, B) :- true.
+
=(A,A).
length([], zero).