AOT, , - . lein repl
( lein run
) uberjar .
lein repl
, REPL , mw.core
, project.clj
, . , , , . ( REPL-), REPL. lein run
- , -main
.
lein uberjar
- , . , clj
, ( SO ). , , , , , , , , , . , uberjar java -jar
, , ( (op)
"" op
, ). , .
, .
, , AOT , , ( , , SO , ). :
project.clj
:
; ...
:profiles {:uberjar {:aot [mw.main]}}) ; note, no `mw.core` here
; ...
main.clj
:
(ns mw.main
(:gen-class))
(defn get-fs []
(require 'mw.core)
@(resolve 'mw.core/fs))
(defn -main [& args]
(println @(get-fs)))
core.clj
:
(ns mw.core
(:gen-class))
(def fs (atom {}))
(defmacro op []
(swap! fs assoc :macro-f "somevalue"))
(op)
, , . , .