Skip to content

Instantly share code, notes, and snippets.

@SamHowie
Created March 24, 2015 04:05
Show Gist options
  • Save SamHowie/aaf8f6b616bb59528ab8 to your computer and use it in GitHub Desktop.
Save SamHowie/aaf8f6b616bb59528ab8 to your computer and use it in GitHub Desktop.
:advanced optimization not removing dead code
(ns example
#_(:require [plumbing.core]))
(defn- map-kv [kf vf m]
(persistent!
(reduce (fn [result [k v]]
(assoc! result (kf k) (vf v)))
(transient {})
m)))
(defn map-keys [f m]
(map-kv f identity m))
#_(.log js/console (plumbing.core/map-keys inc {1 "foo" 2 "bar"}))
(.log js/console (map-keys inc {1 "foo" 2 "bar"}))
(defproject test "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2156"]
[ring "1.2.1"]
[prismatic/plumbing "0.4.1"]]
:plugins [[lein-cljsbuild "1.0.2"]
[lein-ring "0.8.10"]]
:hooks [leiningen.cljsbuild]
:source-paths ["src/clj"]
:cljsbuild {
:builds {
:main {
:source-paths ["src/cljs"]
:compiler {:output-to "resources/public/js/cljs.js"
:optimizations :advanced
:pretty-print false}
:jar true}}}
:main test.server
:ring {:handler test.server/app})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment