mfikes / ambly

ClojureScript REPL into embedded JavaScriptCore
http://ambly.fikesfarm.com
Eclipse Public License 1.0
541 stars 21 forks source link

Eliminate embedded bootstrap JS #88

Closed mfikes closed 9 years ago

mfikes commented 9 years ago

-[ABYContextManager bootstrapWithDepsFilePath:googBasePath:] imitates the bootstrapping code in ambly.core/setup, but contains a vulgar copy of the JS code generated for this bit of logic:

(do
  (set! *loaded-libs* #{"cljs.core"})
  (set! (.-require js/goog)
    (fn [name reload]
      (when (or (not (contains? *loaded-libs* name)) reload)
        (set! *loaded-libs* (conj (or *loaded-libs* #{}) name))
        (js/CLOSURE_IMPORT_SCRIPT
          (aget (.. js/goog -dependencies_ -nameToPath) name)))))))

This is messy, and can probably be re-written directly in Objective-C.