diff options
| author | mryouse | 2022-07-20 03:37:24 +0000 |
|---|---|---|
| committer | mryouse | 2022-07-20 03:37:24 +0000 |
| commit | 0e3581b64d787dc3960f8acb2d6678340895661a (patch) | |
| tree | b7e5ab2d4469b3660584a347a53e2a91fbc0db00 /neb | |
| parent | efeb2d4d5fcbbefe5900d28b15c5cce9bdd20ec4 (diff) | |
WIP make 'howto' print all options
Diffstat (limited to 'neb')
| -rw-r--r-- | neb/__init__.py | 2 | ||||
| -rw-r--r-- | neb/std/repl.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/neb/__init__.py b/neb/__init__.py index 73b6199..8fb2acb 100644 --- a/neb/__init__.py +++ b/neb/__init__.py @@ -167,7 +167,7 @@ class MultiFunction(Callable): self.impls = {} def describe(self): - return [i.describe() for i in self.impls] + return [i.describe() for i in self.impls.values()] def register(self, impl): self.impls[f"{impl.sig}"] = impl diff --git a/neb/std/repl.py b/neb/std/repl.py index f953e18..3168770 100644 --- a/neb/std/repl.py +++ b/neb/std/repl.py @@ -10,7 +10,11 @@ def interpretHowTo(symbol, args, env, ns): target = evaluate(target, env, ns) if not isinstance(target, Callable): raise InterpretPanic(symbol, "expects a func or symbol", args[0]) - print(target.describe()) + des = target.describe() + if isinstance(des, str): + print(des) + else: + print("\n".join(des)) return List([]) REPL.register("howto", Builtin("howto", interpretHowTo, [Arg("symbol", TypeEnum.ANY)], return_type=Type(":list"))) |
