Skip to content

Commit

Permalink
update to use latest memof; alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jul 12, 2020
1 parent f4bbe80 commit 8c630e4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 40 deletions.
52 changes: 22 additions & 30 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -2416,9 +2416,9 @@
|v $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593251136801)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593251137708) (:text |[]) (:id |aBidit7fOnleaf)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593251140779) (:text |caches.core) (:id |PoQCmGLIBh)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531306617) (:text |memof.core) (:id |PoQCmGLIBh)
|r $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593251141298) (:text |:as) (:id |j6uWj8O5kY)
|v $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593251142111) (:text |caches) (:id |rzyIGBToIB)
|v $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531308972) (:text |memof) (:id |rzyIGBToIB)
:id |aBidit7fOn
|v $ {} (:type :expr) (:by |root) (:at 1542475452932) (:id |1Ewu-xKE7G)
:data $ {}
Expand All @@ -2442,28 +2442,15 @@
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250841175) (:text |let) (:id |NE78T8svtleaf)
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250841566)
:data $ {}
|T $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250844094)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250843257) (:text |xs) (:id |zLusppqOyd)
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250845750)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250847398) (:text |concat) (:id |tItyQQ4Izz)
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250848664)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250847777) (:text |f) (:id |bqLmjD46dQ)
|D $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250849342) (:text |[]) (:id |TDkq1DBcd)
:id |1pn0Tcc8K
|r $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250850702) (:text |params) (:id |Xu-04F7e0G)
:id |OkBxY48x7
:id |9L5tFHjSX
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250851701)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250852645) (:text |v) (:id |09S46kWPwrleaf)
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250853126)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250857230) (:text |caches/access-cache) (:id |9oGd_yDq4F)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250857755) (:text |xs) (:id |8uvRH3yYtM)
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531350318) (:text |memof/access-record) (:id |9oGd_yDq4F)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531387206) (:text |params) (:id |8uvRH3yYtM)
|b $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965810507) (:text |*twig-caches) (:id |3LNkATBtSN)
|f $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531322537) (:text |f) (:id |hw0bEMYgQ-)
:id |CHpD4Wcj_
:id |09S46kWPwr
:id |SAuh0X1H1N
Expand Down Expand Up @@ -2494,10 +2481,11 @@
:id |lbbjBGwcDh
|r $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593250875704)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250882922) (:text |caches/write-cache!) (:id |x_vNRTD5Uleaf)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250885255) (:text |xs) (:id |bfJMkNvD6)
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531347623) (:text |memof/write-record!) (:id |x_vNRTD5Uleaf)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531332657) (:text |params) (:id |bfJMkNvD6)
|r $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250888637) (:text |result) (:id |ceoNcmbXW)
|b $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965824796) (:text |*twig-caches) (:id |gF6czmUmrs)
|f $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531331144) (:text |f) (:id |sBZDCjJliv)
:id |x_vNRTD5U
|v $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593250890538) (:text |result) (:id |b8qy4k2-As)
:id |Ef1TVvhEtp
Expand All @@ -2511,7 +2499,7 @@
|r $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593252594077) (:data $ {}) (:id |uVQgK6SXFj)
|v $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593252596729)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593252605045) (:text |caches/reset-caches!) (:id |WY3twp8pUZleaf)
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531345206) (:text |memof/reset-entries!) (:id |WY3twp8pUZleaf)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965832515) (:text |*twig-caches) (:id |-Rcqg5usQ)
:id |WY3twp8pUZ
:id |16IoXLAo1o
Expand All @@ -2522,31 +2510,35 @@
|r $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593253142551) (:data $ {}) (:id |-BwZbUEhVb)
|v $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593253153364)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593253157174) (:text |caches/new-loop!) (:id |p7Vepox3I9)
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531355385) (:text |memof/new-loop!) (:id |p7Vepox3I9)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965835858) (:text |*twig-caches) (:id |YEeYVsaH3u)
:id |_7at-XTN_
:id |WWrUKPPmr6
|*twig-caches $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965811733)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965814009) (:text |defonce) (:id |G_tWv07Xdd)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965811733) (:text |*twig-caches) (:id |n0zcWyTivY)
|r $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965811733)
|r $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1594531314694)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965820605) (:text |caches/new-caches) (:id |e-BzPJANb6)
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965845075)
|T $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965811733)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965845458) (:text |{}) (:id |wUQmS4EsIP)
:id |R9rANgcgU
:id |ZHh8teaNtO
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531313711) (:text |memof/new-states) (:id |e-BzPJANb6)
|j $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965845075)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965845458) (:text |{}) (:id |wUQmS4EsIP)
:id |R9rANgcgU
:id |ZHh8teaNtO
|D $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531315831) (:text |atom) (:id |kOV2H_6nKa)
:id |heCxE3w6X3
:id |ilkArrO1YA
|show-tag-summay $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965917428)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965917428) (:text |defn) (:id |gCEHRo5wA4)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965990334) (:text |show-twig-summay) (:id |kLSZ8gCLGT)
|r $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965917428)
:data $ {}
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965926982) (:text |caches/show-summary!) (:id |lBgFvdHRix)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1593965930458) (:text |*twig-caches) (:id |0iVMhqCwxS)
|T $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531367490) (:text |memof/show-summary) (:id |lBgFvdHRix)
|j $ {} (:type :leaf) (:by |SygU7c6BlG) (:at 1594531363951) (:text |@*twig-caches) (:id |0iVMhqCwxS)
:id |7g4r7jdLK6
|n $ {} (:type :expr) (:by |SygU7c6BlG) (:at 1593965936237) (:data $ {}) (:id |Jz5qvG454)
:id |KuPJrf06Mf
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
:paths ["src" "polyfill"]
:deps {
cumulo/caches {:mvn/version "0.0.1"}
cumulo/memof {:mvn/version "0.2.0-a3"}
}
:aliases {
:release {
Expand Down
2 changes: 1 addition & 1 deletion release.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:version "0.6.1-a2"
{:version "0.6.1-a3"
:group-id "cumulo"
:artifact-id "recollect"
:skip-tag true
Expand Down
2 changes: 1 addition & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[respo "0.12.3"]
[respo/ui "0.3.15"]
[cumulo/util "0.1.12"]
[cumulo/caches "0.1.0-a1"]
[cumulo/memof "0.2.0-a3"]
[respo/value "0.3.0"]
[org.clojure/core.incubator "0.1.4"]
]
Expand Down
16 changes: 9 additions & 7 deletions src/recollect/twig.cljs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@

(ns recollect.twig (:require [caches.core :as caches]) (:require-macros [recollect.twig]))
(ns recollect.twig (:require [memof.core :as memof]) (:require-macros [recollect.twig]))

(defonce *twig-caches (caches/new-caches {}))
(defonce *twig-caches (atom (memof/new-states {})))

(defn call-twig-func [f params]
(let [xs (concat [f] params), v (caches/access-cache *twig-caches xs)]
(let [v (memof/access-record *twig-caches f params)]
(if (some? v)
v
(let [result (apply f params)] (caches/write-cache! *twig-caches xs result) result))))
(let [result (apply f params)]
(memof/write-record! *twig-caches f params result)
result))))

(defn clear-twig-caches! [] (caches/reset-caches! *twig-caches))
(defn clear-twig-caches! [] (memof/reset-entries! *twig-caches))

(defn new-twig-loop! [] (caches/new-loop! *twig-caches))
(defn new-twig-loop! [] (memof/new-loop! *twig-caches))

(defn show-twig-summay [] (caches/show-summary! *twig-caches))
(defn show-twig-summay [] (memof/show-summary @*twig-caches))

0 comments on commit 8c630e4

Please sign in to comment.