Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix cloud-scoped-pred not to wrap for defstat-single.

  • Loading branch information...
commit 13f2c20bee58f81a27b43e9872a21048016e7335 1 parent b49da78
@technomancy technomancy authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/pulse/def.clj
View
11 src/pulse/def.clj
@@ -21,11 +21,13 @@
0
(float (/ (coll-sum c) n)))))
-(def ^:dynamic *cloud*)
+(def ^:dynamic *cloud* nil)
(defn cloud-scoped-pred [pred-fn cloud]
- (fn [evt]
- (and (= (:cloud evt) cloud) (pred-fn evt))))
+ (if cloud
+ (fn [evt]
+ (and (= (:cloud evt) cloud) (pred-fn evt)))
+ pred-fn))
(defn max [time-buffer pred-fn val-fn]
(let [pred-fn (cloud-scoped-pred pred-fn *cloud*)]
@@ -246,8 +248,7 @@
;; for stats which apply across clouds
(defmacro defstat-single [stat-name stat-body]
- `(do (def ~stat-name (merge ~stat-body {:name (name '~stat-name)}))
- (swap! all conj ~stat-name)))
+ `(swap! all conj (merge ~stat-body {:name (name '~stat-name)})))
(defn scope-stat [cloud stat-name]
(if (= cloud (conf/default-cloud))
Please sign in to comment.
Something went wrong with that request. Please try again.