Simple interface wanted to convert cljs forms to js


  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 0.0-3211
  • Fix Version/s: None
  • Component/s: None
  • Labels:


In our project (a clojurescript debugger) we want to convert cljs forms or a sequence of forms into javascript so that they can be executed in the javascript console.

We would like something similar to closure/compile-form-seq (

However, we need to supply, the namespace requires and locals in an env like this

{:ns {:name "test.core" :requires {(quote gstring) (quote goog.string)}} :locals {}}

This code seems to do what we want.

(defn compile-form-seq
    \"Compile a sequence of forms to a JavaScript source string.\"
    [forms env]
    (compiler/with-core-cljs nil
      (fn []
            (doseq [form forms]
              (compiler/emit (analyzer/analyze env form))))))))

I am not sure why I need env/ensure.

Would you be able to patch compile-form-seq to provide the needed interface, or suggest what we should be doing.



David Nolen made changes -
Field Original Value New Value
Fix Version/s Next [ 10362 ]
Affects Version/s 0.0-3211 [ 10356 ]
Priority Major [ 3 ] Minor [ 4 ]
David Nolen made changes -
Fix Version/s Next [ 10362 ]
Mike Fikes made changes -
Patch Code [ 10001 ]


Vote (0)
Watch (1)


  • Created: