Hey Blake,

Yeah, Clojure sits atop the JVM and has access to all its core classes. So
just fire up a repl and evaluate "*java.io.File/pathSeparator*" or
"*(java.lang.Math/abs
-37)*" or something. You can get those Java Interop
<http://clojure.org/java_interop> details here.

As for the Clojure / Java interop implementation, there's a blog post
floating around (that I can't find at the moment), describing the
gymnastics required in the actual language implementation. To start you
down that road, you can read these posts on Clojure's sequence
implementation. Or you can always comb through the Java source
<https://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang> :)

   - Notes on Clojure Sequence Implementations | Benjamin R. Peirce
   <http://bpeirce.me/clojure-sequence-implementations.html>
   - Understanding Clojure's PersistentVector implementation
   
<http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation.html>


Hth

Tim Washington
Interruptsoftware.com <http://interruptsoftware.com>


On Fri, Nov 7, 2014 at 9:32 PM, Blake McBride <blake1...@gmail.com> wrote:

> Greetings,
>
> I am an old lisp guy that is new to Clojure.  At one time I wanted to use
> ABCL as a scripting language for a large, web-based Java app.  (ABCL is
> Common Lisp written in for the JVM.)  The integration and operation of it
> was easy and nice.  I did, however, run into an insurmountable problem.
>
> I created some clue code that, through reflection of a class, discovered
> Java methods and created a CLOS mirror.  Worked well.  The problem I ran
> into is that Java allows more than one method to have the same name
> provided it has a different argument signature.  Lisp can't do that without
> a real lot of work (make generic functions evaluate the arguments and then
> execute the applicable method).  It appeared as a big job to me to have
> Lisp automatically generate all that code for each Java method.  I
> eventually kind of gave up.
>
> It recently occurred to me that the author of Closure probably took that
> problem into account when creating Closure.  So, Closure would be able to
> call Java methods as if they were Closure functions taking into account the
> argument signature.  Does Closure do that?
>
> Also, I presume that a Closure program has immediate access to all Java
> classes and methods without any work.  Is that true?
>
> Thanks.
>
> Blake McBride
>

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