Sweet! So that worked. However, even though unlikely, i would like to
avoid symbol collision. So i tried something like this

(ns ide.handlers
(:use clojure.contrib.with-ns))

(defmacro new-handler-class
  [classname-sym event & body]
  (let [hinted-this (with-meta 'this {:tag classname-sym})]
    `(let [new-ns# (create-ns 'ns-name#)]
       (gen-class
         :name    ~classname-sym
         :extends org.eclipse.core.commands.AbstractHandler
         :init    ~'init
         :impl-ns ns-name#
         :main    false)
      (with-ns new-ns#
       (defn ~'init
         []
         [[] []])
       (defn ~'execute
         [~hinted-this ~event]
         ~...@body)))))


(new-handler-class ide.KeyTest _
  (.println System/out "HI"))



However, this time i get the error
Caused by: java.io.FileNotFoundException: Could not locate
ns_name__154__auto____init.class or ns_name__154__auto__.clj on
classpath:
Again, there is compiled something like ns_name__154__auto__
$init__162.class. I really wonder what these dollar signs signify!

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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to