Re: Passing ClojureScript objects to JavaScript functions

2011-08-11 Thread Kevin Lynagh
Yeah, I ended up writing two such functions for converting Clojure sequentials into JS arrays and maps into JS objects: https://gist.github.com/1141054 (Note that they won't convert a vector containing maps or vice versa properly, so they're not quite "nice functions" yet.) On Aug 11, 2:14 

Re: Passing ClojureScript objects to JavaScript functions

2011-08-11 Thread Ken Wesson
On Thu, Aug 11, 2011 at 5:02 PM, Kevin Lynagh wrote: > Alright, thanks for the info. Do you know why an automatic solution is > out? > > I'm trying to use D3 from ClojureScript, but right now all of the > clarity I get from Clojure's nicer data manipulation abstractions is > lost having to convert

Re: Passing ClojureScript objects to JavaScript functions

2011-08-11 Thread Kevin Lynagh
Alright, thanks for the info. Do you know why an automatic solution is out? I'm trying to use D3 from ClojureScript, but right now all of the clarity I get from Clojure's nicer data manipulation abstractions is lost having to convert to/from JS objects everywhere. On Aug 11, 9:27 am, Brenton wr

Re: Passing ClojureScript objects to JavaScript functions

2011-08-11 Thread Brenton
There is an issue for this: http://dev.clojure.org/jira/browse/CLJS-37 and work is being done to come up with a good solution. The comment in the issue is outdated. There was some discussion last week about how best to do this. I can't remember the details but I know that doing anything automatic

Passing ClojureScript objects to JavaScript functions

2011-08-10 Thread Kevin Lynagh
What is the best way to pass Clojure vectors and maps to JavaScript functions? Currently when I need to call a JavaScript function that takes an array I do something like (js/my_js_fn (.array (vector 1 2 3))) and I pass Clojure maps like (js/my_js_fn (.strobj (hash-map "a" 1 "b" 2))) T