diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-09 20:09:22 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-09 20:09:22 +0000 |
commit | a37ae2f0170499be1a95031d24ff86aac5cf46f1 (patch) | |
tree | fcd3a769a460a5b8a5b54c53cd70ed5d2834a73a /module.c | |
parent | d2a0828140c31514c514b8e4fb9a4d52c389d8fe (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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |