I believe the first parameter must be "this", only in the case of
methods .
The init function doesn't take a "this" parameter.

Here's an example of my problem, MyDerivedClass is a subclass of
Thread.

This doesn't work, because "this" actually refers to the first
argument passed to the constructor. It does not refer to the object
itself.

(ns test)
(gen-class
 :name test.MyDerivedClass
 :extends Thread
 :init init)

(defn -init [this]
  ;The following line doesn't work.
  ;I need to call setName on this object
  ;who's reference is not available yet.
  (println this)
  (. this setName "my derived class")

  ;Superclass constructor
  [[] nil])
--~--~---------~--~----~------------~-------~--~----~
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
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