This seems like the issue discussed in the Clojure Wizard as a function , but when I tried to approach in the top answer, I got an error. Hopefully too much information about my specific application is not needed because it is rather complicated, but here is a distilled version of what I was trying to do:
(defmacro make-fn [m arg1]
`(fn [& args
(eval `(~'~m ~'~arg1 ~@args
I used a macro in this context:
(let [columns (make-columns table-width)
table-name (keyword (str "table_" n))]
(apply (make-fn helpers/tbl table-name) columns))
"helpers / tbl" is a macro that expects a table keyword and a variable number of lists containing column specifications (for example, [: varchar 100] or something else). I am trying to create database table specifications on the fly to facilitate some tests. Anyway, when I try to execute the above code, I get the following error:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: table-name in this context, compiling:(NO_SOURCE_PATH:1)
: , , , , . , . ?