I want to instantiate a record and call a fn from java source code...
I've got this in my .java file:
//prepare java-clojure interop
private static IFn requireFn = RT.var("clojure.core", "require").fn();
static {requireFn.invoke(Symbol.intern("Clondie24.games.chess"));}
//the namespace
private static IFn fitnessFn = RT.var("Clondie24.games.chess",
"ga-fitness").fn(); //the fn I need
....
....
....
private int compete (final MLRegression contestant){
BasicNetwork opponent = pickRandom();
if (!contestant.equals(opponent))
return (Integer)fitnessFn.invoke(new
Clondie24.games.chess.Player(contestant, 1),
new
Clondie24.games.chess.Player(opponent, -1));//the actual tournament
else
return compete(contestant); //recurse once
}
and this in my clj :
(defrecord Player [brain direction])
However i get again: ClassNotFoundException Clondie24.games.chess.Player
It seems I've underestimated the degree of difficulty when going from
clojure to java and back to clojure!
thanks for any pointers...
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