Hello,

When defining a record with defrecord and calling from Java a method
of the record which is implemented by calling the function of another
namespace, the exception IllegalStateException is thrown with error "
attempting to call unbound fn".

An example of this could be something like that:

(ns mynamespace
  (:require [some-stuff :as s])

(defrecord MyRecord
 []
 MyInterface
 (doSomething [this]
    (s/do-something)))

Similar errors are referenced here:

https://groups.google.com/forum/#!msg/clojure-dev/4CtSVWcD15A/shpMuyjMpxsJ

http://stackoverflow.com/questions/10953621/clojure-deftype-calling-function-in-the-same-namespace-throws-java-lang-illegal


A workaround is to use a (require) on the first instruction of the
doSomething method.

For me it looks like a bug and it makes it more difficult than
necessary to interface Clojure from Java for my coworkers.

I'm surprised that this behaviour is still in Clojure 1.5.

Is there some plan to fix that or is "by design" so?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to