From c172274e170a87a30420842ee07ed1f7226d7f2e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 1 Apr 2010 14:35:03 +0000 Subject: * Quick hack to make coerceToString work more or less correctly on nested lists. `nix-instantiate' can now evaluate the NixOS system derivation attribute correctly (in 2.1s on my laptop vs. 6.2s for the trunk). --- src/libexpr/eval.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 49aeb0036..8c8bb219b 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -804,9 +804,12 @@ string EvalState::coerceToString(Value & v, PathSet & context, if (v.type == tList) { string result; for (unsigned int n = 0; n < v.list.length; ++n) { - if (n) result += " "; result += coerceToString(v.list.elems[n], context, coerceMore, copyToStore); + if (n < v.list.length - 1 + /* !!! not quite correct */ + && (v.list.elems[n].type != tList || v.list.elems[n].list.length != 0)) + result += " "; } return result; } -- cgit v1.2.3