aboutsummaryrefslogtreecommitdiff
path: root/neb/std/boolean.py
diff options
context:
space:
mode:
authormryouse2022-06-26 01:31:14 +0000
committermryouse2022-06-26 01:31:14 +0000
commit182a05b85113631a611169a6724162ae9247b55e (patch)
tree4524b495f79c1e71cf1f001edf274c7ccd6a495b /neb/std/boolean.py
parent976c0a01e9e28d13037c9b1a5045789b3500d9fe (diff)
add return types to builtins
Diffstat (limited to 'neb/std/boolean.py')
-rw-r--r--neb/std/boolean.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/neb/std/boolean.py b/neb/std/boolean.py
index 1d99737..973fa67 100644
--- a/neb/std/boolean.py
+++ b/neb/std/boolean.py
@@ -14,7 +14,7 @@ def interpretOr(symbol, args, env, ns):
return Bool(False)
or_arg = Arg("arg", TypeEnum.BOOL, lazy=True)
-BOOLEAN.register("or", Builtin("or", interpretOr, [or_arg, or_arg], or_arg))
+BOOLEAN.register("or", Builtin("or", interpretOr, [or_arg, or_arg], or_arg, Type(":bool")))
def interpretAnd(symbol, args, env, ns):
# and returns false for the first expression that returns false
@@ -26,7 +26,7 @@ def interpretAnd(symbol, args, env, ns):
return ev
return Bool(True)
-BOOLEAN.register("and", Builtin("and", interpretAnd, [or_arg, or_arg], or_arg))
+BOOLEAN.register("and", Builtin("and", interpretAnd, [or_arg, or_arg], or_arg, Type(":bool")))
def interpretEq(symbol, args, env, ns):
# NOTE this currently only works for literals
@@ -37,11 +37,11 @@ def interpretEq(symbol, args, env, ns):
return Bool(False)
eq_arg = Arg("value", TypeEnum.LITERAL)
-BOOLEAN.register("eq?", Builtin("eq?", interpretEq, [eq_arg, eq_arg]))
+BOOLEAN.register("eq?", Builtin("eq?", interpretEq, [eq_arg, eq_arg], return_type=Type(":bool")))
def interpretNot(symbol, args, env, ns):
return Bool(not args[0].value)
not_arg = Arg("not", TypeEnum.BOOL)
-BOOLEAN.register("not", Builtin("not", interpretNot, [not_arg]))
+BOOLEAN.register("not", Builtin("not", interpretNot, [not_arg], return_type=Type(":bool")))