summaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-06 21:23:41 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-06 21:23:41 +0000
commit03738c67684b83692d9112858f07c745f355a157 (patch)
tree61ea389bcadab7211212646ea0c532b7d7635325 /dat.h
parenta0eb2bb268774a85411f037983d931f35bc7830f (diff)
Store the calling module in each goal, and fix a bug where unification could leave behind some bindings even though the unification failed.
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/dat.h b/dat.h
index 783a785..1bde347 100644
--- a/dat.h
+++ b/dat.h
@@ -5,7 +5,7 @@ typedef struct Choicepoint Choicepoint;
typedef struct Clause Clause;
typedef struct Predicate Predicate;
typedef struct Module Module;
-typedef int (*Builtin)(Term *, Binding **);
+typedef int (*Builtin)(Term *, Binding **, Module *);
struct Term
{
@@ -31,6 +31,7 @@ struct Binding
struct Goal
{
Term *goal;
+ Module *module; /* What module is this goal to be evaluated in? */
Term *catcher; /* When this is non-nil, the goal is a catch frame, goal is the recovery. */
Goal *next;
};