diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -14,7 +14,7 @@ int evalquery(Term *query) { Binding *replbindings = nil; - goalstack = addgoals(goalstack, query, usermodule); + goalstack = addgoals(goalstack, query, getmodule(L"user")); while(goalstack->goal != nil){ Term *goal = goalstack->goal; @@ -45,6 +45,15 @@ evalquery(Term *query) }else{ Predicate *pred = findpredicate(module->predicates, goal); if(pred == nil){ + /* To to find it in the system module */ + Module *sysmod; + if(systemmoduleloaded) + sysmod = getmodule(L"system"); + else + sysmod = getmodule(L"user"); + pred = findpredicate(sysmod->predicates, goal); + } + if(pred == nil){ Rune *name; int arity; Term *replacement = nil; |