Hi, Am 27.10.2009 um 04:18 schrieb Gorsal:
> I guess this is a very similar error to the one above mentioned. I
> guess i sort of nested ns again. Do you have any suggestions for
> preventing name clashing of the functions?
Use gensym:
(defmacro new-handler-class
[classname-sym event & body]
(let [...
prefix (name (gensym simple-classname))
prefixed #(symbol (str prefix "-" %))
...]
`(do
(gen-class
...
:prefix ~(symbol (str prefix "-"))
...)
(defn ~(prefixed "init")
...)
(defn ~(prefixed "execute")
...))))
I'm referring to what I wrote earlier (with all the ...). But I hope
you get the idea. Use gensym to generate a prefix. Providing the
simple-classname helps when debugging. Instead of G123, you get Baz345.
Sincerely
Meikel
smime.p7s
Description: S/MIME cryptographic signature
