You can use the namespace itself as the mapping. For example:
(ns app.commands)
(defn dothis [& args] ...)
(defn dothat [& args] ...)
(ns app)
(defn execute-command [name & args]
(let [var (ns-resolve 'app.commands
On Wed, May 28, 2014 at 8:05 PM, Will Duquette wrote:
> If there's a better place to ask this kind of question, please point me in
> the right direction!
>
> I'm learning Clojure, and part of the project I'm making is a command
> language: the user can type commands at the application in somethin
You can do this using multimethods. defmulti and defmethod will allow you
to do everything you ask for apart from adding a doc-string to each
command. Have a look at:
http://clojuredocs.org/clojure_core/clojure.core/defmulti
On Thursday, May 29, 2014 3:05:56 AM UTC+2, Will Duquette wrote:
>
> I
If there's a better place to ask this kind of question, please point me in
the right direction!
I'm learning Clojure, and part of the project I'm making is a command
language: the user can type commands at the application in something like a
REPL, and have a dialog with the application. I want