Hi again (busy day eh?),

well this doesn't make any sense either! Why is a record with type-hinted arguments still using reflection?
I've got the following example record:
--------------------------------------------------------------------------------------------------
(defrecord CheckersPiece [^java.awt.Color color
                                           ^java.awt.Point position
                                              rank]
 Piece
 (update-position [this np] ;mutable state inside Point!
   (. position setLocation  ;can accept ints or doubles
     (first np) (second np))) ;np should be [x, y]
(die [this] (vary-meta this assoc :dead true)) ;communicate death through meta-data (promote [this] (make-checker color position :rank 'prince)) ; a checker is promoted to prince
 (getGridPosition [this] (vector (.getX position) (.getY position)))
(getListPosition [this] (translate-position (first (.getGridPosition this)) (second (.getGridPosition this)) board-mappings-checkers))
 (getPoint [this] position)
 (getMoves [this] nil) ;TODO
 Object
 (toString [this]
(println "Checker (" rank ") at position:" (.getListPosition this) " ->" (.getGridPosition this))) )
---------------------------------------------------------------------------------------------------------------------------
and whenever i call update-position it complains that setLocation cannot be resolved. setLocation is a method in java.awt.Point so i don't see why this happens!

any suggestions?

Jim

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