1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

* Implemented the primops necessary for generating the NixOS manual.

This commit is contained in:
Eelco Dolstra 2010-04-07 13:55:46 +00:00
parent a353aef0b1
commit fc92244ba8
8 changed files with 160 additions and 146 deletions

View file

@ -169,17 +169,16 @@ public:
type. */
bool evalBool(Env & env, Expr e);
/* Evaluate an expression, and recursively evaluate list elements
and attributes. */
void strictEval(Expr e, Value & v);
void strictEval(Env & env, Expr e, Value & v);
/* If `v' is a thunk, enter it and overwrite `v' with the result
of the evaluation of the thunk. If `v' is a delayed function
application, call the function and overwrite `v' with the
result. Otherwise, this is a no-op. */
void forceValue(Value & v);
/* Force a value, then recursively force list elements and
attributes. */
void strictForceValue(Value & v);
/* Force `v', and then verify that it has the expected type. */
int forceInt(Value & v);
bool forceBool(Value & v);
@ -190,6 +189,10 @@ public:
string forceString(Value & v, PathSet & context);
string forceStringNoCtx(Value & v);
/* Return true iff the value `v' denotes a derivation (i.e. a
set with attribute `type = "derivation"'). */
bool isDerivation(Value & v);
/* String coercion. Converts strings, paths and derivations to a
string. If `coerceMore' is set, also converts nulls, integers,
booleans and lists to a string. If `copyToStore' is set,
@ -219,10 +222,10 @@ private:
elements and attributes are compared recursively. */
bool eqValues(Value & v1, Value & v2);
void callFunction(Value & fun, Value & arg, Value & v);
public:
void callFunction(Value & fun, Value & arg, Value & v);
/* Allocation primitives. */
Value * allocValues(unsigned int count);
Env & allocEnv();
@ -237,6 +240,10 @@ public:
};
/* Return a string representing the type of the value `v'. */
string showType(Value & v);
#if 0
/* Evaluate an expression to normal form. */
Expr evalExpr(EvalState & state, Expr e);