From 3899312e81d383d4900dc95b9d96faf1cc73db15 Mon Sep 17 00:00:00 2001 From: mryouse Date: Sun, 5 Jun 2022 03:34:12 +0000 Subject: bugfix: Bool, not Boolean --- interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'interpreter.py') diff --git a/interpreter.py b/interpreter.py index 47b2363..60338f1 100644 --- a/interpreter.py +++ b/interpreter.py @@ -389,7 +389,7 @@ def interpretBranch(symbol, args, env): if len(arg.args) != 2: raise InterpretPanic(symbol, "each branch requires two expressions") cond = evaluate(arg.args[0], env) # this is the condition - if not isinstance(cond, Boolean): + if not isinstance(cond, Bool): raise InterpretPanic(symbol, "branch condition must be :bool", cond) if cond.value: return evaluate(arg.args[1], env) @@ -467,7 +467,7 @@ def interpretListLength(symbol, args, env): ev = evaluate(args[0], env) if not isinstance(ev, List): raise InterpretPanic(symbol, "requires a :list", ev) - return Literal(len(ev.args)) + return Int(len(ev.args)) GLOBALS.register("list-length", Builtin(interpretListLength, 1)) -- cgit v1.2.3