Hello,

One solution I've applied in the past:

if the clojure classes depend on the java classes in the implementation and
not in their interfaces ( extends, implements, methods signatures ), then
you can write your gen-class with a separate namespace for the
implementation of the class ( using :impl-ns ). Then you compile clojure
code in 2 pass : 1/ compile the namespaces that use call gen-class and
gen-interface for generating the class stubs 2/ compile java 3/ compile all
the remaining clojure code.

This one is not tested but should work: if the clojure classes depend on the
java classes even in the signature, then maybe it could be easier to define
these classes squeletons in java, and extend them for implementation in
clojure.
So 1/ create class ASqueleton java source code 2/ compile java , 3/ create
gen-class that extends ASqueleton 4/ compile clojure

HTHal (*),

-- 
Laurent

(Hope This Helps a little)

2009/10/15 jng27 <[email protected]>

>
> The following seems like it could be a common scenario when attempting
> to re-write parts of an existing Java application in Clojure.
>
> Let's say there exists Clojure code and Java code in the same
> 'project'.
> The Clojure code depends on the Java code in one direction and then
> the same is true in the opposite direction.
> Given that compiling Java and Clojure require separate and different
> compilation steps, how would circular dependencies be resolved ?
> e.g. A class is defined in the Clojure code that references Java
> classes(yet to be compiled) and the same is true for the Java code
> referencing classes defined in Clojure(yet to be compiled). It doesn't
> seem like compiling one before the other would solve this issue.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to