summaryrefslogtreecommitdiff
path: root/module.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-09 20:09:22 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-09 20:09:22 +0000
commita37ae2f0170499be1a95031d24ff86aac5cf46f1 (patch)
treefcd3a769a460a5b8a5b54c53cd70ed5d2834a73a /module.c
parentd2a0828140c31514c514b8e4fb9a4d52c389d8fe (diff)
Add asserta/1, assertz/1, retract/1, abolish/1 (and retract_one/1, which is retract/1 but doesn't backtrack)
Diffstat (limited to 'module.c')
-rw-r--r--module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module.c b/module.c
index bd7ca22..8e1f043 100644
--- a/module.c
+++ b/module.c
@@ -6,8 +6,6 @@
#include "fns.h"
Module *addemptymodule(Rune *);
-Clause *appendclause(Clause *, Clause *);
-Predicate *appendpredicate(Predicate *, Predicate *);
void
initmodules(void)
@@ -21,6 +19,7 @@ initmodules(void)
Predicate *p;
for(p = systemmodule->predicates; p != nil; p = p->next){
p->builtin = 1;
+ p->dynamic = 0;
}
usermodule = addemptymodule(L"user");
@@ -70,7 +69,7 @@ parsemodule(char *file)
cl->body = t->children->next;
}else{
cl->head = t;
- cl->body = nil;
+ cl->body = mkatom(L"true");
}
if(cl->head->tag == AtomTerm)
arity = 0;
@@ -89,6 +88,7 @@ parsemodule(char *file)
currentpred->clauses = cl;
currentpred->public = 1; /* everything is public for now */
currentpred->builtin = 0;
+ currentpred->dynamic = 1; /* everything is dynamic for now */
currentpred->next = nil;
}else
currentpred->clauses = appendclause(currentpred->clauses, cl);