about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-01T09·55+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-01T09·55+0000
commit71f026292ba1b401237a16ab6e0fb57c36c93df5 (patch)
treecb8f403db6cf31755db25b0a8db461aacae302dd /src/libexpr/eval.hh
parentdc31305b381f69de5ac5fd4776df1a802045ff00 (diff)
* Make `derivation' lazy again for performance. It also turns out
  that there are some places in Nixpkgs (php_configurable /
  composableDerivation, it seems) that call `derivation' with
  incorrect arguments (namely, the `name' attribute missing) but get
  away with it because of laziness.

Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 13ea269fc69d..34b658ce13e4 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -104,6 +104,14 @@ static inline void mkBool(Value & v, bool b)
 }
 
 
+static inline void mkThunk(Value & v, Env & env, Expr expr)
+{
+    v.type = tThunk;
+    v.thunk.env = &env;
+    v.thunk.expr = expr;
+}
+
+
 void mkString(Value & v, const char * s);
 void mkString(Value & v, const string & s, const PathSet & context = PathSet());
 void mkPath(Value & v, const char * s);