mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
parent
a4aac7f88c
commit
b37f5ae31d
1 changed files with 12 additions and 1 deletions
|
@ -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)
|
static void prim_isFunction(EvalState & state, const Pos & pos, Value * * args, Value & v)
|
||||||
{
|
{
|
||||||
state.forceValue(*args[0]);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue