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 Articleclojure, 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
More Pages to Explore .....