

ClojureScript Compiler Compiled with ClojureScript - lispython
https://github.com/kanaka/clojurescript

======
S4M
I never ran ClojureScript, but I am curious about the procedure to call
functions from other java script libraries. Is it as seamless as the call of a
java function from the JVM Clojure?

~~~
piranha
Yes, it is. You can just do (js/$ ".something") and you'll get jQuery object
back.

~~~
dribnet
And if you are lucky enough to be dealing with a _functional_ javascript
library like d3, you can even use cljs functions as arguments to your js
library. This leads to very succinct and powerful interop.

For example:

    
    
      (.timer js/d3 (fn []
            (-> root (.selectAll "g") (.data curClockData)
                (.select "path")
                (.attr "class" #(str (:key %) (:which %))))
            ; return false to keep running
            false))))
    

This snippet does this twice to provide a longish function to the d3.timer
call and a small inline one to attr to set a class based on the data in the
selection. More context available: <http://bl.ocks.org/4326896>

ObTopic: cljs in cljs does sound dreamy. Would this also enable <script
type="text/clojurescript">?

~~~
swannodette
Nice D3 example!

I predict we will see an "official" CLJS-in-CLJS around the time of the next
Clojure/conj ;)

~~~
kanaka
And hopefully "unofficial" CLJS-in-CLJS by Clojure West. :-)

I just pushed type/record/protocol/reify support. Next big thing is to fix
runtime namespace creation. Then file I/O. Then all the bugs discovered while
try to compile the compiler using the compiled compiler (i.e. self-hosting).

