Re: Good way of handling metric gathering?

2016-11-11 Thread Shantanu Kumar
Hi Tianxiang, In my experience a good way to decouple a non-trivial fn with metrics is to make the fn provide hooks for various events when metrics may be gathered. (defn nop [& args]) (defn foo->bar [foo {:keys [on-foo on-bar] :or {on-foo nop on-bar nop} :as options}] (on-foo) (let [bar (

Good way of handling metric gathering?

2016-11-11 Thread Tianxiang Xiong
What are some good ways of handling metric gathering (or, more generally, AOP) in Clojure? Suppose we have an application in which there is a transformation function, foo->bar. Every time a foo is input to foo->bar, we'd like to increment the foo-counter. Every time a bar is produced, we'd like

Re: defrecord in cljc

2016-11-11 Thread William la Forge
To answer my own question, it is because IPrintWithWriter is already defined for records. Only define this with deftype. On Friday, November 11, 2016 at 3:16:46 PM UTC-5, William la Forge wrote: > > WARNING: Protocol IPrintWithWriter implemented multiple times at line 9 > src\simpleArk\rolonReco

defrecord in cljc

2016-11-11 Thread William la Forge
WARNING: Protocol IPrintWithWriter implemented multiple times at line 9 src\simpleArk\rolonRecord.cljc Any ideas? (ns simpleArk.rolonRecord) #?(:clj (defrecord Rolon-record [rolon-uuid]) :cljs (defrecord Rolon-record [rolon-uuid] ;;this is line 9 IPrintWithWriter