Re: How to call Clojure from Java?

2017-06-26 Thread Didier
Using gen-class or the Clojure Java API like Daniel showed are the best ways I know of. If you want static types in Java and auto-complete, and things to feel like Java, use gen-class, if not, use the Clojure Java API. On Saturday, 24 June 2017 12:05:55 UTC-7, thelmuth wrote: > > Thanks for the

Re: How to call Clojure from Java?

2017-06-24 Thread thelmuth
Thanks for the suggestions! Daniel's code helped me a lot, thanks! One thing that had me stuck for a while is that you have to have a Clojure jar in your classpath. I also worked through a different way, using an uberjar of a Clojure project. I posted my guides here

Re: How to call Clojure from Java?

2017-06-04 Thread Mark Bastian
I recently put together a project that demonstrates a few ways to call Clojure from Java: https://github.com/markbastian/java-calls-clojure Hope that helps. -Mark -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: How to call Clojure from Java?

2017-06-01 Thread Daniel Compton
Hi thelmuth Here's a fully worked example. It calls the Clojure function myco.dashed-namespace.app.core/start!. Save it to src/myco/dashed_namespace/app/Main.java. package myco.dashed_namespace.app; import clojure.java.api.Clojure; import clojure.lang.IFn; public class Main { public static

Re: How to call Clojure from Java?

2017-06-01 Thread James Reeves
There's a brief section on this on the Clojure website: https://clojure.org/reference/java_interop#_calling_clojure_from_java On 2 June 2017 at 01:35, thelmuth wrote: > What is the best way to call a Clojure function from Java? > > Most of the resources I have found are either very old or don't

How to call Clojure from Java?

2017-06-01 Thread thelmuth
What is the best way to call a Clojure function from Java? Most of the resources I have found are either very old or don't go into enough detail. I am a Clojure programmer with very little Java background, and have been having trouble with the methods I've found, especially classpath issues. -

Re: call clojure from java

2014-02-18 Thread Alex Miller
FYI, as of Clojure 1.6, you will use the clojure.java.api.Clojure class to obtain vars instead of RT. http://clojure.github.io/clojure/javadoc/clojure/java/api/Clojure.html But I would actually recommend creating a Java interface that looks just how want it, and then implement that interface in

Re: call clojure from java

2014-02-18 Thread sorin cristea
Hi guys, Thanks for your information. I would take the advantage of concurrency in clojure and implement a concurrent scenario in clojure and call it from java code. For example I want to read/modify the content of file from many threads, this scenario I want to implement in clojure, and call t

Re: call clojure from java

2014-02-18 Thread Stathis Sideris
I think you're looking for this method here: https://skillsmatter.com/skillscasts/3864-impromptu-rich-hickey-lightning-talk (you need to register to see the video) On Tuesday, 18 February 2014 11:39:20 UTC, sorin cristea wrote: > > Hi > > do you know how I can call a clojure script from a java

Re: call clojure from java

2014-02-18 Thread Sunil S Nandihalli
sorry I misread the email! On Tue, Feb 18, 2014 at 6:17 PM, Michael Klishin < michael.s.klis...@gmail.com> wrote: > > 2014-02-18 16:00 GMT+04:00 Sunil S Nandihalli > : > > You can't call a clojurescript function from java. However you can call >> clojure-code from Java and clojurescript code fr

Re: call clojure from java

2014-02-18 Thread Michael Klishin
2014-02-18 16:00 GMT+04:00 Sunil S Nandihalli : > You can't call a clojurescript function from java. However you can call > clojure-code from Java and clojurescript code from javascript. I think the idea is to call a Clojure script (with a space) from Java. Use clojure.lang.RT#var and clojure.l

Re: call clojure from java

2014-02-18 Thread Shantanu Kumar
Hi Sorin, Are you looking for something like load-file: http://clojuredocs.org/clojure_core/clojure.core/load-file Shantanu On Tuesday, 18 February 2014 17:09:20 UTC+5:30, sorin cristea wrote: > > Hi > > do you know how I can call a clojure script from a java method ? > > > Thanks, > Sorin. >

Re: call clojure from java

2014-02-18 Thread Sunil S Nandihalli
You can't call a clojurescript function from java. However you can call clojure-code from Java and clojurescript code from javascript. On Tue, Feb 18, 2014 at 5:09 PM, sorin cristea wrote: > Hi > > do you know how I can call a clojure script from a java method ? > > > Thanks, > Sorin. > > -- >

call clojure from java

2014-02-18 Thread sorin cristea
Hi do you know how I can call a clojure script from a java method ? Thanks, Sorin. -- 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 - pleas

Re: why my java code (call clojure from java ) run spend so much loooooog time .

2014-02-13 Thread Andy-
FYI: http://stackoverflow.com/questions/21759848/ On Thursday, February 13, 2014 11:02:07 AM UTC-5, Xiaojun Weng wrote: > > I am a new clojure player,but i have wrote java code by few years. > > when i use emacs run my clojure code (read a big file 50M ) , nrepl run > over use 30 second. > but

Re: why my java code (call clojure from java ) run spend so much loooooog time .

2014-02-13 Thread Dennis Haupt
give your vm more memory 2014-02-13 17:02 GMT+01:00 Xiaojun Weng : > I am a new clojure player,but i have wrote java code by few years. > > when i use emacs run my clojure code (read a big file 50M ) , nrepl run > over use 30 second. > but i use lein uberjar clojure to jar .and i use it jar i

why my java code (call clojure from java ) run spend so much loooooog time .

2014-02-13 Thread Xiaojun Weng
I am a new clojure player,but i have wrote java code by few years. when i use emacs run my clojure code (read a big file 50M ) , nrepl run over use 30 second. but i use lein uberjar clojure to jar .and i use it jar in eclipse , this jar import in a embeded jetty when it started, some time