Have you ever wanted to abandon a simple program with a bug that has
been DRIVING YOU CRAZY because it's just got to be something SO
simple, you'd be embarrassed to admit that you didn't see WHAT WAS
STARING YOU IN THE FACE all along? Well, this is mine:

(ns org.InfoML.genclassObject
 (:gen-class
   :extends [java.lang.Object]
   :init init
   :constructors {[] []}
   :state state))

(defn -init [s]
  [[] (ref "foo")])


(defn -main []
  (let [x (new org.InfoML.genclassObject)]
    (println x)))

I'm beyond getting clues that will help me solve my original problem--
it just bothers me that I can't figure out what's happening.

Whether I compile the org.InfoML package or not, I get the same error
message:

Exception in thread "main" java.lang.ClassNotFoundException: [java/
lang/Object] (genclassObject.clj:1)
... (a bunch of lines omitted here) ...
Caused by: java.lang.ClassNotFoundException: [java/lang/Object]
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at clojure.lang.RT.classForName(RT.java:1504)
        at clojure.core$the_class__7054.invoke(genclass.clj:91)
        at clojure.core$generate_class__7060.invoke(genclass.clj:99)
        at clojure.core$gen_class__7189.doInvoke(genclass.clj:593)
        at clojure.lang.RestFn.invoke(RestFn.java:761)
        at clojure.lang.Var.invoke(Var.java:421)
        at clojure.lang.AFn.applyToHelper(AFn.java:289)
        at clojure.lang.Var.applyTo(Var.java:476)
        at clojure.lang.Compiler.macroexpand1(Compiler.java:4504)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:4578)
        ... 34 more

And what's with the slashes in "[java/lang/Object]"--I've never seen
that before.

I beg your forbearance in advance. Please, make the pain stop.

PS to Mikel: Regarding my original goal, converting the
GraphEditor.java program to Clojure, it should be obvious that my
objective is not simply to get an example program running onscreen.
Rather, I really want an answer to a specific question. That question
is, "In Java, I can add new behavior to the constructor of an original
class that I'm subclassing. And yet, the constructor is a special case
because its name is the name of the superclass. How can I do the same
thing in Clojure?" Yes, I'm stubborn. Misguided, too, probably.

-- 
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