* 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).
This commit is contained in:
Eelco Dolstra 2010-04-01 14:35:03 +00:00
parent 7b851915bf
commit c172274e17

View file

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