0

我得到这个编译错误说:Invalid token: function-name

(defn execute-task-from-message
  "Parses the message dictionary, gets the function-name and arguments-list
   and applys the function on the arguments"
  [{function-name: "function-name"
    arguments-list: "arguments-list"} msg]
  (when-let [task (ns-resolve
                   *ns*
                   (symbol
                   (str task-namespace function-name)))]
    (apply task arguments-list)))

我的代码出了什么问题?

4

1 回答 1

0

你的论点中有一些额外:的 s 解构 pehaps?如果您包含一些堆栈跟踪和更多上下文,我可能会更具体:

user> (def task-namespace "where-does-this-come-from")
#'user/task-namespace
user> (defn execute-task-from-message
          "Parses the message dictionary, gets the function-name and arguments-list
           and applys the function on the arguments"
        [{function-name "function-name"
          arguments-list "arguments-list"} msg]
          (when-let [task (ns-resolve *ns*
                            (symbol 
                               (str task-namespace function-name)))]
           (apply task arguments-list))) 

#'user/execute-task-from-message 
于 2013-11-08T07:14:29.847 回答