If I have a running REPL, can I print out all symbols that have been defined? Is there some way to know what has been defined in the REPL I'm using?
Asked
Active
Viewed 138 times
3 Answers
1
In order to be able to know what symbols have been defined in a namespace in your REPL use the following code:
(keys (ns-publics 'my-name-space))
This answser comes from this Stackoverflow post. How to list the functions of a namespace?
Use the code below to print to a string.
(pr-str (keys (ns-publics 'my-name-space)))
Below is a full example in the form of a screenshot taken of LightTable.
0
First, you need to find all namespaces:
(all-ns)
Then, you must decide what you want to collect. For example, the documentation on namespaces lists the following functions for examining namespaces:
For example, you can have all intern mappings like this:
(reduce conj (map ns-interns (all-ns)))

coredump
- 37,664
- 5
- 43
- 77
-
1I'd like to add this to be correct too...great answer too. – ftravers Aug 28 '15 at 02:46