Skip to content

Instantly share code, notes, and snippets.

@mjg123
Created August 8, 2011 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjg123/1132536 to your computer and use it in GitHub Desktop.
Save mjg123/1132536 to your computer and use it in GitHub Desktop.
core clojurescript
(ns game.core
(:require [goog.graphics :as gfx]
[goog.events :as events]
[goog.events.KeyCodes :as key-codes]
[goog.events.KeyHandler :as key-handler]
[game.ui :as ui])
; core game logic
(ui/foo)
(ns game.ui
(:require [goog.dom :as dom])
(defn foo []
; whatever...
)
@mjg123
Copy link
Author

mjg123 commented Aug 8, 2011

To be clear, I am building by using the cljs repl in the same directory as these files, and issuing:

(time (cljsc/build "core.cljs" {:optimizations :advanced :output-to "game.js"}))

I get the error

IllegalArgumentException No implementation of method: :-compile of protocol: #'cljs.closure/Compilable found for class: nil clojure.core/-cache-protocol-fn (core_deftype.clj:494)

This does work fine if (defn foo...) is in the core.cljs file and I don't try to require anything except goog.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment