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 srncris...@gmail.com wrote:

 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 - 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/groups/opt_out.


-- 
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/groups/opt_out.


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.


-- 
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/groups/opt_out.


Re: call clojure from java

2014-02-18 Thread Michael Klishin
2014-02-18 16:00 GMT+04:00 Sunil S Nandihalli sunil.nandiha...@gmail.com:

 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.lang.IFn#invoke to call
clojure.core/load-file
and similar clojure.core functions:

http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
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/groups/opt_out.


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 sunil.nandiha...@gmail.com
 :

 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.lang.IFn#invoke to call
 clojure.core/load-file
 and similar clojure.core functions:


 http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java
 --
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin

 --
 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/groups/opt_out.


-- 
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/groups/opt_out.


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 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 - 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/groups/opt_out.


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 this from 
java, in order to avoid the implementation of this scenario in java to put 
locks on file when it's modify by one thread.

Sorin

On Tuesday, February 18, 2014 3:10:18 PM UTC+2, Stathis Sideris wrote:

 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 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 - 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/groups/opt_out.


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 Clojure (via reify, 
extending a defrecord, etc). 


On Tuesday, February 18, 2014 6:47:38 AM UTC-6, Michael Klishin wrote:


 2014-02-18 16:00 GMT+04:00 Sunil S Nandihalli 
 sunil.na...@gmail.comjavascript:
 :

 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.lang.IFn#invoke to call 
 clojure.core/load-file
 and similar clojure.core functions:


 http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java
 -- 
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin
  

-- 
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/groups/opt_out.