mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 01:26:15 +02:00
* Functions are incomparable.
This commit is contained in:
parent
71f026292b
commit
95cc417d76
1 changed files with 13 additions and 6 deletions
|
@ -69,16 +69,17 @@ std::ostream & operator << (std::ostream & str, Value & v)
|
||||||
string showType(Value & v)
|
string showType(Value & v)
|
||||||
{
|
{
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
case tString: return "a string";
|
|
||||||
case tPath: return "a path";
|
|
||||||
case tNull: return "null";
|
|
||||||
case tInt: return "an integer";
|
case tInt: return "an integer";
|
||||||
case tBool: return "a boolean";
|
case tBool: return "a boolean";
|
||||||
case tLambda: return "a function";
|
case tString: return "a string";
|
||||||
|
case tPath: return "a path";
|
||||||
case tAttrs: return "an attribute set";
|
case tAttrs: return "an attribute set";
|
||||||
case tList: return "a list";
|
case tList: return "a list";
|
||||||
|
case tNull: return "null";
|
||||||
|
case tLambda: return "a function";
|
||||||
|
case tPrimOp: return "a built-in function";
|
||||||
case tPrimOpApp: return "a partially applied built-in function";
|
case tPrimOpApp: return "a partially applied built-in function";
|
||||||
default: throw Error("unknown type");
|
default: throw Error(format("unknown type: %1%") % v.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +300,7 @@ void EvalState::eval(Env & env, Expr e, Value & v)
|
||||||
char x;
|
char x;
|
||||||
if (&x < deepestStack) deepestStack = &x;
|
if (&x < deepestStack) deepestStack = &x;
|
||||||
|
|
||||||
debug(format("eval: %1%") % e);
|
//debug(format("eval: %1%") % e);
|
||||||
|
|
||||||
nrEvaluated++;
|
nrEvaluated++;
|
||||||
|
|
||||||
|
@ -864,6 +865,12 @@ bool EvalState::eqValues(Value & v1, Value & v2)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Functions are incomparable. */
|
||||||
|
case tLambda:
|
||||||
|
case tPrimOp:
|
||||||
|
case tPrimOpApp:
|
||||||
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw Error(format("cannot compare %1% with %2%") % showType(v1) % showType(v2));
|
throw Error(format("cannot compare %1% with %2%") % showType(v1) % showType(v2));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue