Displaying functions generated for the REPL

56 views
Skip to first unread message

Cecil Westerhof

unread,
Jul 23, 2016, 5:28:11 AM7/23/16
to clo...@googlegroups.com
For a project I define some extra functions if it is started in the REPL. I like to know which extra functions there are in the REPL, so at the moment I am doing the following:
   (print (str "Defined REPL functions:\n"
               "- do-show-schemas\n"
               "- do-show-table [table]\n"
               "- do-show-tables\n"
               "- get-h2-version\n"
               "- get-random-quotes <[nr]>\n"
               )
          )

The problem with this is that every time I add or remove a function I need to change this print. Is there a way to generate this list? I probably lose the parameters, but for a long list of functions this could be handy.

--
Cecil Westerhof

Jason Felice

unread,
Jul 23, 2016, 10:21:22 AM7/23/16
to clo...@googlegroups.com
If they are all in one namespace, you can use `ns-publics` on that namespace ... e.g. `(ns-publics 'user)`.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages