aboutsummaryrefslogtreecommitdiff
path: root/neb/std/functools.py
diff options
context:
space:
mode:
authormryouse2022-06-22 00:59:28 +0000
committermryouse2022-06-22 00:59:28 +0000
commitf126db2e1d476d5f7457594bcb318a5cb5f0c528 (patch)
treee23fc55a7d864cc47685c6199ce1775c265f1a85 /neb/std/functools.py
parentf2c9f51359f7f2c7a1b968bc72ca911b7bb2b2d0 (diff)
give builtin functions proper names
Diffstat (limited to 'neb/std/functools.py')
-rw-r--r--neb/std/functools.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/neb/std/functools.py b/neb/std/functools.py
index 59f4a2a..83475b9 100644
--- a/neb/std/functools.py
+++ b/neb/std/functools.py
@@ -1,4 +1,4 @@
-from .. import TypeEnum, Environment, Arg, Builtin, Function, evaluate
+from .. import TypeEnum, Environment, Arg, Builtin, Function, evaluate, InterpretPanic
from ..structs import *
FUNCTOOLS = Environment()
@@ -17,7 +17,7 @@ def interpretFilter(symbol, args, env, ns):
out.append(arg)
return List(out)
-FUNCTOOLS.register("filter", Builtin(interpretFilter, [Arg("func", TypeEnum.ANY), Arg("list", TypeEnum.LIST)]))
+FUNCTOOLS.register("filter", Builtin("filter", interpretFilter, [Arg("func", TypeEnum.ANY), Arg("list", TypeEnum.LIST)]))
def interpretMap(symbol, args, env, ns):
func = args[0]
@@ -32,7 +32,7 @@ def interpretMap(symbol, args, env, ns):
out.append(ev)
return List(out)
-FUNCTOOLS.register("map", Builtin(interpretMap, [Arg("func", TypeEnum.ANY), Arg("list", TypeEnum.LIST)]))
+FUNCTOOLS.register("map", Builtin("map", interpretMap, [Arg("func", TypeEnum.ANY), Arg("list", TypeEnum.LIST)]))
def interpretApply(symbol, args, env, ns):
# TODO: to support lambdas, we can't assume the func is defined
@@ -42,5 +42,5 @@ def interpretApply(symbol, args, env, ns):
new_lst = List([func] + args[1].args)
return evaluate(new_lst, env, ns)
-FUNCTOOLS.register("apply", Builtin(interpretApply, [Arg("func", TypeEnum.ANY, lazy=True), Arg("list", TypeEnum.LIST)]))
+FUNCTOOLS.register("apply", Builtin("apply", interpretApply, [Arg("func", TypeEnum.ANY, lazy=True), Arg("list", TypeEnum.LIST)]))