diff options
| -rw-r--r-- | neb/__init__.py | 3 | ||||
| -rw-r--r-- | neb/std/fs.py | 13 | ||||
| -rw-r--r-- | neb/structs.py | 3 |
3 files changed, 1 insertions, 18 deletions
diff --git a/neb/__init__.py b/neb/__init__.py index 63b6d51..4831019 100644 --- a/neb/__init__.py +++ b/neb/__init__.py @@ -107,9 +107,6 @@ class Function(Callable): arg = self.args[idx] else: arg = self.many - if arg.lazy: - ret.append(param) - continue ev = evaluate(param, env, ns) expected_name = f"{arg.type_}" expected_type = env.get(expected_name) diff --git a/neb/std/fs.py b/neb/std/fs.py index d20cde9..144df0f 100644 --- a/neb/std/fs.py +++ b/neb/std/fs.py @@ -31,19 +31,6 @@ def interpretUnlink(symbol, args, env, ns): FS.register("unlink", Builtin("unlink", interpretUnlink, [Arg("filename", TypeEnum.STRING)], return_type=Type(":list"))) -def interpretWithWrite(symbol, args, env, ns): - target_file = args[0] - new_env = Environment(env) - target_path = Path(target_file.value).resolve() - ret = Literal([]) - with open(str(target_path), "w") as fil: - new_env.register("_file_", List([fil])) # TODO wrong! - for arg in args[1:]: - ret = evaluate(arg, new_env, ns) - return ret - -FS.register("with-write", Builtin("with-write", interpretWithWrite, [Arg("filename", TypeEnum.STRING)], Arg("exprs", TypeEnum.ANY, lazy=True))) - def interpretWrite(symbol, args, env, ns): string = args[0] handle = args[1] diff --git a/neb/structs.py b/neb/structs.py index c5707a4..88c4c6f 100644 --- a/neb/structs.py +++ b/neb/structs.py @@ -129,11 +129,10 @@ class List: # function things class Arg: - def __init__(self, name, type_, *, optional=False, lazy=False): + def __init__(self, name, type_, *, optional=False): self.name = name self.type_ = type_ self.optional = optional - self.lazy = lazy def __str__(self): return f"{self.name} {self.type_}" |
