I'm now making a class object with Clojure which has a method returning the object itself.
Written with Java, the object that I'd like to make is like,
class Point {
public double x;
public double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public Point copy() {
return new Point(this.x, this.y);
}
}
The current clojure code that I wrote is like,
(ns myclass.Point
:gen-class
:prefix "point-"
:init init
:state state
:constructors {[double double] []}
:methods [[copy [] myclass.Point]]))
(defn point-init [x y]
[[] {:x x :y y}])
(defn point-copy [this]
this)
However, I got an error as follows.
java.lang.ClassNotFoundException: myclass.Point
While I have googled about this issue, I couldn't find any answers. Does anyone know the solution for this issue?
Thank you in advance for your help.