On Thu, Feb 26, 2009 at 8:36 PM, Daniel Spiewak <djspie...@gmail.com> wrote:
>
>> > > Note that you cannot mix Java and Clojure sources within the same
>> > > project.
>
> It is supported in the latest changeset.  The following configurations
> are possible:
>
> ---------------------
> Just Clojure:
>  * src/main/clojure
>
> Clojure and Scala:
>  * src/main/clojure
>  * src/main/scala
>
> Clojure, Scala and Java:
>  * src/main/clojure
>  * src/main/scala
>  * src/main/java
>
> Clojure and Groovy:
>  * src/main/clojure
>  * src/main/groovy
>
> Clojure, Groovy and Java:
>  * src/main/clojure
>  * src/main/groovy
>  * src/main/java
>
> Clojure and Java:
>  * src/main/clojure
>  * src/main/java
> ---------------------
>
> You'll notice that "Clojure, Scala and Groovy" is not among the
> possibilities.  This is because the Groovy joint compiler and the
> Scala joint compiler both expect to be able to interleave Java
> dependencies within their type resolution process.  They do not have
> support for the same functionality with each other, meaning that
> circular dependencies cannot be compiled between the two languages.

Who needs those other languages anyway ;)

>
> Note that this is all predicated on a (possibly faulty) assumption
> about the Clojure compiler: everything must be late-bound.  If
> Clojure's compiler needs to resolve types at compile-time, then this
> could potentially fail in unexpected ways.  Specifically, circular
> dependencies between Clojure and Java/Scala/Groovy would not be
> possible.  In such a case, you would need to somehow factor the
> circularity out into a separate .clj file and then exclude that file
> from compilation (forcing late binding).  I honestly don't know if
> this is the compiler's behavior or not, but I thought it was worth the
> warning.

To bump this one up again....

I only got around to playing with this again recently, and it seems
that I can't access ie. static methods on my Java types. If I
understand correctly, the Clojure code is compiled before the Java
code. I don't think that makes much sense, since Java would call into
Clojure through Vars which are always resolved at runtime, whereas
Clojure would like to know about concrete types when calling into Java
so it can avoid expensive reflection.


>
> One small change: in order to use this functionality now, you will
> need to include the following line at the top of your buildfile:
>
> require 'buildr/clojure'
>
> Joint compilation with Scala/Java or Groovy/Java does not necessitate
> an extra "require", but this first one is necessary to get the process
> started and ensure that Clojure's compiler becomes the dominant
> selection.
>
> Daniel
> >
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to