1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

* Allow primops with more that 1 arguments.

This commit is contained in:
Eelco Dolstra 2004-08-04 10:59:20 +00:00
parent e3a50f7e25
commit bbfdd64741
7 changed files with 102 additions and 104 deletions

View file

@ -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);
};