Open asampal opened 2 years ago
All currently-defined symbols can be accessed via the symbols
command, as a dictionary (name-value).
Starting from there you can obviously get whatever you want (note: there was a tiny issue with the REPL not handling nested templates well, but it has also been fixed as per the latest PR).
For example:
This returns an array of tuples (name / description) for each of the defined built-in functions. 😉
map select keys symbols => [function?.builtin var] 'sym -> @[sym, get info.get sym 'description]
This is pretty much the same like:
map
select keys symbols 'sym [
function?.builtin var sym
]
'sym [
@[
sym,
get info.get sym 'description
]
]
P.S. That being said, the whole thing reminds that I have to add dictionary support for all the remaining functions in the Iterators module, so that e.g. you can select the items you want from a given dictionary and get back a dictionary. I always end up using similar things (as would be the case here), but I still haven't implemented it for Arturo... :S
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing issue as stale.
Issue is still active.
@drkameleon How should we name this?
@drkameleon How should we name this?
Good question. It could be functions
and work in an identical way as symbols
, only returning just the functions?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It would be great to have a function that allows introspection over all defined functions (possibly scoped by some of the functions' metadata) in order to be able to act on the other metadata. I can see this being helpful for tooling (e.g. a language server that might want to provide prioritized auto-completion when in a particular module, etc.).
Maybe this is already there and I missed it (since I guess something like this is being used to generate some of the documentation).