4 ms·
Or a Clojure PersistentHashMap behind an Atom. That's the idiomatic way to do caching in Clojure. It would work just fine in regular Java, and you could wrap
by dreish 17y ago
Or a Clojure PersistentHashMap behind an Atom. That's the idiomatic way to do caching in Clojure. It would work just fine in regular Java, and you could wrap the Atom in a class that converts the usual java.util.Map methods to their equivalent Atom/PersistentHashMap operations and completely hides the fact that you're using (a non-transactional) part of the Clojure persistence framework.
You don't even need Lisp! (Like any Java programmer, you will need wrist braces in a few years, though.)