Quantcast
Channel: clojure, dynamic-var, need macro? - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by Joost Diepenmaat for clojure, dynamic-var, need macro?

To answer the question: you want var-set instead of set!.Quick question: if you're passing in the variable, do you really need a dynamic var?[Also, I want this to be a dynamic-var, not an atom]Can you...

View Article



clojure, dynamic-var, need macro?

BackgroundI'm trying to write the following function: (defn cache-get [dynamic-var k func] (if-let [v (get-in dynamic-var k)] v (let [ans (func)] (set! dynamic-var (assoc-in dvar k ans)) ans)))The...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images