Great - thanks for the tips! My gist example was applying the 1.6 Clojure API, but I was not sure if anything has evolved through 1.7 and 1.8.
I will check out the Tapestry approach. I like the idea of mapping an interface to a namespace. Patrick On Monday, May 2, 2016 at 1:18:47 AM UTC-4, Howard M. Lewis Ship wrote: > > You can also look into this: > > > http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/clojure/package-summary.html > > It's an extension to the Tapestry 5 IoC container that allow you to map an > interface to a Clojure namespace. You define the Java interface and supply > a mapping, via naming conventions or annotations, to a Clojure namespace. > Invoke the Java method and the corresponding Clojure function is invoked, > efficiently. > > On Sun, May 1, 2016 at 6:08 PM, Timothy Baldridge <tbald...@gmail.com > <javascript:>> wrote: > >> Ah apparently someone also added a section to the docs on it: >> http://clojure.org/reference/java_interop#_calling_clojure_from_java >> >> On Sun, May 1, 2016 at 7:06 PM, Timothy Baldridge <tbald...@gmail.com >> <javascript:>> wrote: >> >>> 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.pm...@gmail.com >>> <javascript:>> 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 clo...@googlegroups.com >>>> <javascript:> >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> clojure+u...@googlegroups.com <javascript:> >>>> 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+u...@googlegroups.com <javascript:>. >>>> 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) >>> >> >> >> >> -- >> “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 clo...@googlegroups.com >> <javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> 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+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Howard M. Lewis Ship > > Senior Mobile Developer at Walmart Labs > > Creator of Apache Tapestry > > (971) 678-5210 > http://howardlewisship.com > @hlship > -- 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.