Take a look at this class:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/java/api/Clojure.java
It was added in Clojure 1.6 exactly for this use-case, and will be quite
fast, especially if you store the vars somewhere and only look them up
once.

Timothy

On Sun, May 1, 2016 at 6:28 PM, Patrick Martin <prof.pmarti...@gmail.com>
wrote:

> I am working on a Clojure/Java stack, where the Java layer uses Vert.x to
> manage a collection of embedded computers and the Clojure layer would allow
> interaction with this system dynamically. I am designing a Clojure DSL that
> would allow a user to load new functions and deploy them live into the Java
> framework. My current design is to push a Clojure function string into the
> Java layer and use the guidance from this post to execute:
> http://stackoverflow.com/questions/2181774/calling-clojure-from-java/23555959#23555959
>
> Here is a gist example based on that thread:
> https://gist.github.com/anonymous/f443b7acb1fcd6b1acf816a25f917ccd
>
> Since the S.O. thread was from 2014, I was curious if there might be
> newer/better ways to do this operation.
>
> Thanks in advance for any guidance or thoughts!
>
> ps: I will not call Vertx directly as I already have a Java codebase that
> wraps the functionality I need. I am really interested in dynamically
> creating and running new functions by leveraging Clojure on top of this
> Java framework.
>
> --
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

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