about summary refs log tree commit diff
path: root/src/fix-ng/primops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fix-ng/primops.cc')
-rw-r--r--src/fix-ng/primops.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/fix-ng/primops.cc b/src/fix-ng/primops.cc
index ef0fd354ef6d..f5a278f669b5 100644
--- a/src/fix-ng/primops.cc
+++ b/src/fix-ng/primops.cc
@@ -225,3 +225,16 @@ Expr primToString(EvalState & state, Expr arg)
         return ATmake("Str(<str>)", s);
     else throw badTerm("cannot coerce to string", arg);
 }
+
+
+Expr primNull(EvalState & state, Expr arg)
+{
+    return ATmake("Null");
+}
+
+
+Expr primIsNull(EvalState & state, Expr arg)
+{
+    arg = evalExpr(state, arg);
+    return makeBool(ATmatch(arg, "Null"));
+}