Re: Crazy Need: Embed JavaScript Structure in Clojure

2015-04-28 Thread Atamert Ölçgen
On Tue, Apr 28, 2015 at 10:44 AM, Gary Verhaegen wrote: > On 28 April 2015 at 07:39, Atamert Ölçgen wrote: > > Perhaps you can write a function that builds a function somewhere and > then > > outputs a string containing JavaScript code that invokes it. > > > > (defn js [& body] > > (eval `(def

Re: Crazy Need: Embed JavaScript Structure in Clojure

2015-04-28 Thread Gary Verhaegen
On 28 April 2015 at 07:39, Atamert Ölçgen wrote: > Perhaps you can write a function that builds a function somewhere and then > outputs a string containing JavaScript code that invokes it. > > (defn js [& body] > (eval `(defn fn-name# [] ~@body)) > (str "function() { your.ns." fn-name# "(); }"

Re: Crazy Need: Embed JavaScript Structure in Clojure

2015-04-27 Thread Atamert Ölçgen
Hi JPatrick, On Mon, Apr 27, 2015 at 11:50 PM, JPatrick Davenport wrote: > Hello, > So just to get it out: I do not want to evaluate the JavaScript, simply > preserve it. > > I'm working on an ArangoDB driver. Part of the wonder that is ArangoDB is > its ability to support transactions. This is

Crazy Need: Embed JavaScript Structure in Clojure

2015-04-27 Thread JPatrick Davenport
Hello, So just to get it out: I do not want to evaluate the JavaScript, simply preserve it. I'm working on an ArangoDB driver. Part of the wonder that is ArangoDB is its ability to support transactions. This is done using JSON. Part of the REST object for a transaction is what I want to do in t