Im attempting to create a named class inside another namespace like
this:
(ns ide.handlers
(:import [org.eclipse.ui.commands AbstractHandler]))
(defmacro new-handler-class [n event & body]
`(do
(ns ~n
(:gen-class :extends
~'org.eclipse.ui.commands.AbstractHandler :init ~'init))
(defn ~'-init [] [[][]])
(defn ~'-execute [~'this ~event]
~...@body)))
(new-handler-class ide.KeyTest _
(.print System/out "HI"))
However, when i (compile 'ide.handlers) it generate a class named
KeyTest$_init_307.class along with KeyTest.class.
When i attempt to launch, i get the following error
Caused by: java.io.FileNotFoundException: Could not locate ide/
KeyTest__init.class or ide/KeyTest.clj on classpath:
So, apparently i need a KeyTest_init instead of a KeyTest$_init_307?
Why in the heck is KeyTest.class not referring to the KeyTest
$_init_307? How do i get this to work? I don't want to create a new
file per class name. And renaming the file doesn't work, i guess the
class name is stored inside somewhere.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---