about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 34ac467f1d80..b51a5b07988c 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -12,16 +12,16 @@ typedef map<Path, PathSet> DrvPaths;
 typedef map<Path, Hash> DrvHashes;
 
 struct EvalState;
-typedef Expr (* PrimOp0) (EvalState &);
-typedef Expr (* PrimOp1) (EvalState &, Expr arg);
+
+/* Note: using a ATermVector is safe here, since when we call a primop
+   we also have an ATermList on the stack. */
+typedef Expr (* PrimOp) (EvalState &, const ATermVector & args);
 
 
 struct EvalState 
 {
     ATermMap normalForms;
-    ATermMap primOps0; /* nullary primops */
-    ATermMap primOps1; /* unary primops */
-    ATermMap primOpsAll;
+    ATermMap primOps;
     DrvPaths drvPaths;
     DrvHashes drvHashes; /* normalised derivation hashes */
     Expr blackHole;
@@ -31,8 +31,9 @@ struct EvalState
 
     EvalState();
 
-    void addPrimOp0(const string & name, PrimOp0 primOp);
-    void addPrimOp1(const string & name, PrimOp1 primOp);
+    void addPrimOps();
+    void addPrimOp(const string & name,
+        unsigned int arity, PrimOp primOp);
 };