Nope. I moved the main code to ns hexadoku.core (generating package hexadoku, class core) and did the deftype in hexadoku (generating package hexadoku, class HexSolver). The error remains
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Var hexadoku.core/search is unbound. at clojure.lang.Var.deref(Var.java:142) at clojure.lang.Var.get(Var.java:133) at hexadoku.HexSolver.solve(hexadoku.clj:10) 2011/3/29 Ken Wesson <kwess...@gmail.com> > On Mon, Mar 28, 2011 at 8:46 AM, Mark Meyer <ofo...@googlemail.com> wrote: > > Hi. > > I'm having problems calling clojure code from Java. Basically I deftype'd > > (deftype HexSolver [] > > Solver > > (solve [this grid] (search (process-grid grid)))) > > and somewhere near the top of that file file > > (defn search [foo] ...) > > the very top places this in the namepsace (:ns hexadoku (:gen-class)). > > Now calling this I get the following backtrace: > > Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: > Var > > hexadoku/search is unbound. > > at clojure.lang.Var.deref(Var.java:142) > > at clojure.lang.Var.get(Var.java:133) > > at hexadoku.HexSolver.solve(hexadoku.clj:128) > > This is from another project, that includes the hexadoku.jar. > > Do I have to do some explicit export to use the function from a deftype > or > > is this some library loading problem? > > Probably the latter, and specifically probably a default package > problem. Under the hood you've generated a class called hexadoku in > the default package. Try foo.hexadoku or hexadoku.core or something as > the namespace name and see if that fixes it. > > -- > 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 -- 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