diff options
| author | mryouse | 2022-07-15 00:31:23 +0000 |
|---|---|---|
| committer | mryouse | 2022-07-15 00:31:23 +0000 |
| commit | 6812b01b2cd789fbdded74e0a3ff40bb39d849ff (patch) | |
| tree | 3c918a4cdba63afc72fe1d5555670b41789cd4af /neb/std/repl.py | |
| parent | 0b8216c9d9a08f4d475b38fc55b71618a0e5a503 (diff) | |
let 'howto' accept a quoted symbol as well
Diffstat (limited to 'neb/std/repl.py')
| -rw-r--r-- | neb/std/repl.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/neb/std/repl.py b/neb/std/repl.py index 7ea383e..f953e18 100644 --- a/neb/std/repl.py +++ b/neb/std/repl.py @@ -5,9 +5,12 @@ from ..structs import * REPL = Environment() def interpretHowTo(symbol, args, env, ns): - if not isinstance(args[0], Callable): - raise InterpretPanic(symbol, "expects a :func", args[0]) - print(args[0].describe()) + target = args[0] + if isinstance(target, Symbol): + target = evaluate(target, env, ns) + if not isinstance(target, Callable): + raise InterpretPanic(symbol, "expects a func or symbol", args[0]) + print(target.describe()) return List([]) REPL.register("howto", Builtin("howto", interpretHowTo, [Arg("symbol", TypeEnum.ANY)], return_type=Type(":list"))) |
