I think there's a problem with the new clojure/ns and gen-and-save-
class.
Suppose you define:
(clojure/ns com.example
(:use clojure.contrib.pred))
(defn MyClass-close [this]
(println "Hello, World!"))
And you generate a .class file with:
(gen-and-save-class
*classes-dir*
"com.example.MyClass"
:implements [java.io.Closeable])
Then, at runtime, when com/example/MyClass.clj gets loaded, clojure/ns
does not (refer 'clojure) because the namespace already exists. So
you get:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.example.Main.main(Main.java:5)
Caused by: clojure.lang.Compiler$CompilerException: MyClass.clj:8:
Unable to resolve symbol: defn in this context
If you replace (clojure/ns...) with:
(clojure/in-ns 'com.example)
(clojure/refer 'clojure)
(use 'clojure.contrib.pred)
then it works fine.
-Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---