Skip to content
Browse files

Using core.cache/through

  • Loading branch information...
1 parent 8f587ff commit 74986c876fdcca33405bf7bb5aed81dd7df3643d @fogus fogus committed Mar 17, 2013
Showing with 9 additions and 4 deletions.
  1. +1 −1 project.clj
  2. +8 −3 src/main/clojure/clojure/core/memoize.clj
View
2 project.clj
@@ -1,7 +1,7 @@
(defproject core.memoize "0.5.3-SNAPSHOT"
:description "A memoization library for Clojure."
:dependencies [[org.clojure/clojure "1.5.0-master-SNAPSHOT"]
- [org.clojure/core.cache "0.6.2"]]
+ [org.clojure/core.cache "0.6.3"]]
:plugins [[lein-swank "1.4.4"]
[lein-marginalia "0.7.1"]]
:repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}
View
11 src/main/clojure/clojure/core/memoize.clj
@@ -47,9 +47,14 @@
;; # Auxilliary functions
-#_(def through* clojure.core.cache/through)
-
-(defn- through*
+(defn through* [cache f item]
+ (clojure.core.cache/through
+ #(delay (%1 %2))
+ #(clojure.core/apply f %)
+ cache
+ item))
+
+#_(defn- through*
"The basic hit/miss logic for the cache system. Clojure delays are used
to hold the cache value."
[cache f item]

0 comments on commit 74986c8

Please sign in to comment.
Something went wrong with that request. Please try again.