isFunction: True on primops.

Fixes #2073
This commit is contained in:
Shea Levy 2018-04-17 14:33:12 -04:00
parent a4aac7f88c
commit b37f5ae31d
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -271,7 +271,18 @@ static void prim_isNull(EvalState & state, const Pos & pos, Value * * args, Valu
static void prim_isFunction(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
state.forceValue(*args[0]);
mkBool(v, args[0]->type == tLambda);
bool res;
switch (args[0]->type) {
case tLambda:
case tPrimOp:
case tPrimOpApp:
res = true;
break;
default:
res = false;
break;
}
mkBool(v, res);
}