Brian Craft <craft.br...@gmail.com> writes:

Hi Brian,

> The cast error, however, persists. It's something to do with reloading
> the namespace with the defrecord.

Ah, yes, I've had that, too, even without AOT compilation.  Basically,
you simply cannot reload/recompile protocols, deftypes, definterfaces,
and defrecords and expect that functions working with them that are not
recompiled afterwards still do their job.  I think the reason is that
all those generate interfaces implicitly, and after a reload, you get a
new interface with the same name as the original one but still different
and loaded from a new class loader.  Thus, the old one is inaccessible
and things like checking if an old instance of your record is an
instance of the (now new) interface will fail.

So I usually put all my protocols etc. in a separate file that I don't
need to recompile frequently.  Then I can recompile the namespaces/files
that use those data types and protocols freely.  If I really need to
change a data type or protocol, well then I need to recompile the
complete project.  For that, clojure/tools.namespace is nice.

Bye,
Tassilo

-- 
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/d/optout.

Reply via email to