From 00c5c7e2c043949ee8b3d6c32b01d338102da51f Mon Sep 17 00:00:00 2001 From: mryouse Date: Thu, 14 Jul 2022 01:54:25 +0000 Subject: exprs are of type list --- neb/std/types.py | 2 +- neb/structs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'neb') diff --git a/neb/std/types.py b/neb/std/types.py index 35dca42..0ce8b52 100644 --- a/neb/std/types.py +++ b/neb/std/types.py @@ -27,7 +27,7 @@ TYPES.register("int?", Builtin("int?", interpretIsInt, [Arg("arg", TypeEnum.ANY) def interpretIsList(symbol, args, env, ns): # if it's not a list, we're done - if not isinstance(args[0], List): + if not (isinstance(args[0], List) or isinstance(args[0], Expr)): return Bool(False) # if the symbol isn't a type, we're done diff --git a/neb/structs.py b/neb/structs.py index 45e69a7..db74106 100644 --- a/neb/structs.py +++ b/neb/structs.py @@ -119,14 +119,14 @@ class Symbol: def __init__(self, name, line): self.name = name self.line = line - self.type_ = TypeEnum.ANY # TODO no it's not + self.type_ = ALL_TYPES[":any"] # TODO no it's not def __str__(self): return f"{self.name}" class Expr: def __init__(self, args): self.args = args - self.type_ = TypeEnum.ANY # TODO no it's not + self.type_ = ALL_TYPES[":[]"] # TODO no it's not def __str__(self): return "(" + " ".join(f"{arg}" for arg in self.args) + ")" -- cgit v1.2.3