From 9b58c1f6eff0ffa673971f21adc4491078c8e174 Mon Sep 17 00:00:00 2001 From: mryouse Date: Mon, 13 Jun 2022 02:47:00 +0000 Subject: implement howto --- interpreter.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/interpreter.py b/interpreter.py index 2f6dc3d..3cbd2cd 100644 --- a/interpreter.py +++ b/interpreter.py @@ -793,3 +793,12 @@ def interpretAssert(symbol, args, env): return List([]) GLOBALS.register("assert", Builtin(interpretAssert, [Arg("cond", TypeEnum.BOOL, False, False)])) + +def interpretHowTo(symbol, args, env): + if not isinstance(args[0], Symbol): + raise InterpretPanic(symbol, "expects a symbol", args[0]) + sym = env.get(args[0].name) + print(sym.describe(args[0].name)) + return List([]) + +GLOBALS.register("howto", Builtin(interpretHowTo, [Arg("symbol", TypeEnum.ANY, False, True)])) -- cgit v1.2.3