diff options
| author | mryouse | 2022-07-22 01:11:19 +0000 |
|---|---|---|
| committer | mryouse | 2022-07-22 01:11:19 +0000 |
| commit | bff7f43c039eea0b247beedcfa53598b433dbe21 (patch) | |
| tree | 7d1d55b492f4d506f21ff124b34377f36788ed6e /neb | |
| parent | 53e83fadfa9a0c2f254c4f940c0538d0c6e60492 (diff) | |
bugfix: user-funcs and user-symbols to support mf
Diffstat (limited to 'neb')
| -rw-r--r-- | neb/std/repl.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/neb/std/repl.py b/neb/std/repl.py index 0ad7454..573ecc8 100644 --- a/neb/std/repl.py +++ b/neb/std/repl.py @@ -52,9 +52,9 @@ REPL.register("funcs", funcs_multi) def interpretUserSymbols(symbol, args, env, ns): if len(args) == 1 and args[0].value: - keys = [Symbol(k, -1, True) for k,v in env.get_all().items() if isinstance(v, UserFunction) or isinstance(v, Literal)] + keys = [Symbol(k, -1, True) for k,v in sorted(env.get_all().items()) if (isinstance(v, MultiFunction) and v.user_impl()) or isinstance(v, Literal)] else: - keys = [Symbol(k, -1, True) for k,v in env.get_all().items() if (isinstance(v, UserFunction) or isinstance(v, Literal)) and not k.startswith(".")] + keys = [Symbol(k, -1, True) for k,v in sorted(env.get_all().items()) if ((isinstance(v, MultiFunction) and v.user_impl()) or isinstance(v, Literal)) and not k.startswith(".")] return List(keys) usersymbols_nonhidden_func = Builtin("user-symbols", interpretUserSymbols, [], return_type=Type(":list")) @@ -66,9 +66,9 @@ REPL.register("user-symbols", usersymbols_multi) def interpretUserFuncs(symbol, args, env, ns): if len(args) == 1 and args[0].value: - keys = [Symbol(k, -1, True) for k,v in env.get_all().items() if isinstance(v, UserFunction)] + keys = [Symbol(k, -1, True) for k,v in sorted(env.get_all().items()) if isinstance(v, MultiFunction) and v.user_impl()] else: - keys = [Symbol(k, -1, True) for k,v in env.get_all().items() if isinstance(v, UserFunction) and not k.startswith(".")] + keys = [Symbol(k, -1, True) for k,v in sorted(env.get_all().items()) if isinstance(v, MultiFunction) and v.user_impl() and not k.startswith(".")] return List(keys) userfuncs_nonhidden_func = Builtin("user-funcs", interpretUserFuncs, [], return_type=Type(":list")) |
