datahike 0.7.1630
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +226 -0
- package/cljs.analyzer.api.js +427 -0
- package/cljs.analyzer.api.js.map +1 -0
- package/cljs.analyzer.impl.js +86 -0
- package/cljs.analyzer.impl.js.map +1 -0
- package/cljs.analyzer.impl.namespaces.js +219 -0
- package/cljs.analyzer.impl.namespaces.js.map +1 -0
- package/cljs.analyzer.js +7186 -0
- package/cljs.analyzer.js.map +1 -0
- package/cljs.analyzer.passes.and_or.js +141 -0
- package/cljs.analyzer.passes.and_or.js.map +1 -0
- package/cljs.analyzer.passes.js +104 -0
- package/cljs.analyzer.passes.js.map +1 -0
- package/cljs.cache.js +1145 -0
- package/cljs.cache.js.map +1 -0
- package/cljs.cache.wrapped.js +352 -0
- package/cljs.cache.wrapped.js.map +1 -0
- package/cljs.core.async.impl.buffers.js +489 -0
- package/cljs.core.async.impl.buffers.js.map +1 -0
- package/cljs.core.async.impl.channels.js +711 -0
- package/cljs.core.async.impl.channels.js.map +1 -0
- package/cljs.core.async.impl.dispatch.js +81 -0
- package/cljs.core.async.impl.dispatch.js.map +1 -0
- package/cljs.core.async.impl.ioc_helpers.js +192 -0
- package/cljs.core.async.impl.ioc_helpers.js.map +1 -0
- package/cljs.core.async.impl.protocols.js +368 -0
- package/cljs.core.async.impl.protocols.js.map +1 -0
- package/cljs.core.async.impl.timers.js +510 -0
- package/cljs.core.async.impl.timers.js.map +1 -0
- package/cljs.core.async.js +8813 -0
- package/cljs.core.async.js.map +1 -0
- package/cljs.core.js +38764 -0
- package/cljs.core.js.map +1 -0
- package/cljs.env.js +60 -0
- package/cljs.env.js.map +1 -0
- package/cljs.nodejs.js +80 -0
- package/cljs.nodejs.js.map +1 -0
- package/cljs.reader.js +462 -0
- package/cljs.reader.js.map +1 -0
- package/cljs.spec.alpha.js +5312 -0
- package/cljs.spec.alpha.js.map +1 -0
- package/cljs.spec.gen.alpha.js +2020 -0
- package/cljs.spec.gen.alpha.js.map +1 -0
- package/cljs.tagged_literals.js +103 -0
- package/cljs.tagged_literals.js.map +1 -0
- package/cljs.tools.reader.edn.js +960 -0
- package/cljs.tools.reader.edn.js.map +1 -0
- package/cljs.tools.reader.impl.commons.js +217 -0
- package/cljs.tools.reader.impl.commons.js.map +1 -0
- package/cljs.tools.reader.impl.errors.js +441 -0
- package/cljs.tools.reader.impl.errors.js.map +1 -0
- package/cljs.tools.reader.impl.inspect.js +182 -0
- package/cljs.tools.reader.impl.inspect.js.map +1 -0
- package/cljs.tools.reader.impl.utils.js +429 -0
- package/cljs.tools.reader.impl.utils.js.map +1 -0
- package/cljs.tools.reader.js +1830 -0
- package/cljs.tools.reader.js.map +1 -0
- package/cljs.tools.reader.reader_types.js +838 -0
- package/cljs.tools.reader.reader_types.js.map +1 -0
- package/cljs_env.js +18192 -0
- package/cljs_node_io.core.js +1278 -0
- package/cljs_node_io.core.js.map +1 -0
- package/cljs_node_io.file.js +918 -0
- package/cljs_node_io.file.js.map +1 -0
- package/cljs_node_io.fs.js +3911 -0
- package/cljs_node_io.fs.js.map +1 -0
- package/clojure.data.js +319 -0
- package/clojure.data.js.map +1 -0
- package/clojure.edn.js +119 -0
- package/clojure.edn.js.map +1 -0
- package/clojure.set.js +406 -0
- package/clojure.set.js.map +1 -0
- package/clojure.string.js +502 -0
- package/clojure.string.js.map +1 -0
- package/clojure.walk.js +156 -0
- package/clojure.walk.js.map +1 -0
- package/datahike.api.impl.js +621 -0
- package/datahike.api.impl.js.map +1 -0
- package/datahike.api.specification.js +85 -0
- package/datahike.api.specification.js.map +1 -0
- package/datahike.array.js +275 -0
- package/datahike.array.js.map +1 -0
- package/datahike.config.js +437 -0
- package/datahike.config.js.map +1 -0
- package/datahike.connections.js +55 -0
- package/datahike.connections.js.map +1 -0
- package/datahike.connector.js +1248 -0
- package/datahike.connector.js.map +1 -0
- package/datahike.constants.js +66 -0
- package/datahike.constants.js.map +1 -0
- package/datahike.core.js +628 -0
- package/datahike.core.js.map +1 -0
- package/datahike.datom.js +963 -0
- package/datahike.datom.js.map +1 -0
- package/datahike.db.interface.js +819 -0
- package/datahike.db.interface.js.map +1 -0
- package/datahike.db.js +3095 -0
- package/datahike.db.js.map +1 -0
- package/datahike.db.search.js +1004 -0
- package/datahike.db.search.js.map +1 -0
- package/datahike.db.transaction.js +1904 -0
- package/datahike.db.transaction.js.map +1 -0
- package/datahike.db.utils.js +642 -0
- package/datahike.db.utils.js.map +1 -0
- package/datahike.gc.js +1618 -0
- package/datahike.gc.js.map +1 -0
- package/datahike.impl.entity.js +604 -0
- package/datahike.impl.entity.js.map +1 -0
- package/datahike.index.interface.js +484 -0
- package/datahike.index.interface.js.map +1 -0
- package/datahike.index.js +50 -0
- package/datahike.index.js.map +1 -0
- package/datahike.index.persistent_set.js +1250 -0
- package/datahike.index.persistent_set.js.map +1 -0
- package/datahike.js.api.js +2211 -0
- package/datahike.js.api.js.map +1 -0
- package/datahike.lru.js +404 -0
- package/datahike.lru.js.map +1 -0
- package/datahike.pull_api.js +533 -0
- package/datahike.pull_api.js.map +1 -0
- package/datahike.query.js +11891 -0
- package/datahike.query.js.map +1 -0
- package/datahike.query_stats.js +152 -0
- package/datahike.query_stats.js.map +1 -0
- package/datahike.readers.js +166 -0
- package/datahike.readers.js.map +1 -0
- package/datahike.schema.js +251 -0
- package/datahike.schema.js.map +1 -0
- package/datahike.schema_cache.js +66 -0
- package/datahike.schema_cache.js.map +1 -0
- package/datahike.spec.js +70 -0
- package/datahike.spec.js.map +1 -0
- package/datahike.store.js +514 -0
- package/datahike.store.js.map +1 -0
- package/datahike.tools.js +436 -0
- package/datahike.tools.js.map +1 -0
- package/datahike.writer.js +3463 -0
- package/datahike.writer.js.map +1 -0
- package/datahike.writing.js +3168 -0
- package/datahike.writing.js.map +1 -0
- package/datalog.parser.impl.js +1421 -0
- package/datalog.parser.impl.js.map +1 -0
- package/datalog.parser.impl.proto.js +213 -0
- package/datalog.parser.impl.proto.js.map +1 -0
- package/datalog.parser.impl.util.js +117 -0
- package/datalog.parser.impl.util.js.map +1 -0
- package/datalog.parser.js +47 -0
- package/datalog.parser.js.map +1 -0
- package/datalog.parser.pull.js +2603 -0
- package/datalog.parser.pull.js.map +1 -0
- package/datalog.parser.type.js +7502 -0
- package/datalog.parser.type.js.map +1 -0
- package/datalog.parser.util.js +60 -0
- package/datalog.parser.util.js.map +1 -0
- package/environ.core.js +263 -0
- package/environ.core.js.map +1 -0
- package/fress.api.js +607 -0
- package/fress.api.js.map +1 -0
- package/fress.impl.adler32.js +435 -0
- package/fress.impl.adler32.js.map +1 -0
- package/fress.impl.bigint.js +185 -0
- package/fress.impl.bigint.js.map +1 -0
- package/fress.impl.buffer.js +1087 -0
- package/fress.impl.buffer.js.map +1 -0
- package/fress.impl.codes.js +105 -0
- package/fress.impl.codes.js.map +1 -0
- package/fress.impl.hopmap.js +603 -0
- package/fress.impl.hopmap.js.map +1 -0
- package/fress.impl.ranges.js +49 -0
- package/fress.impl.ranges.js.map +1 -0
- package/fress.impl.raw_input.js +837 -0
- package/fress.impl.raw_input.js.map +1 -0
- package/fress.impl.raw_output.js +653 -0
- package/fress.impl.raw_output.js.map +1 -0
- package/fress.impl.table.js +133 -0
- package/fress.impl.table.js.map +1 -0
- package/fress.reader.js +2312 -0
- package/fress.reader.js.map +1 -0
- package/fress.util.js +458 -0
- package/fress.util.js.map +1 -0
- package/fress.writer.js +2141 -0
- package/fress.writer.js.map +1 -0
- package/geheimnis.aes.js +132 -0
- package/geheimnis.aes.js.map +1 -0
- package/hasch.base64.js +42 -0
- package/hasch.base64.js.map +1 -0
- package/hasch.benc.js +201 -0
- package/hasch.benc.js.map +1 -0
- package/hasch.core.js +188 -0
- package/hasch.core.js.map +1 -0
- package/hasch.platform.js +221 -0
- package/hasch.platform.js.map +1 -0
- package/incognito.base.js +276 -0
- package/incognito.base.js.map +1 -0
- package/incognito.edn.js +54 -0
- package/incognito.edn.js.map +1 -0
- package/incognito.fressian.js +330 -0
- package/incognito.fressian.js.map +1 -0
- package/index.d.ts +660 -0
- package/is.simm.partial_cps.async.js +142 -0
- package/is.simm.partial_cps.async.js.map +1 -0
- package/is.simm.partial_cps.runtime.js +65 -0
- package/is.simm.partial_cps.runtime.js.map +1 -0
- package/is.simm.partial_cps.sequence.js +1255 -0
- package/is.simm.partial_cps.sequence.js.map +1 -0
- package/konserve.cache.js +2519 -0
- package/konserve.cache.js.map +1 -0
- package/konserve.compressor.js +502 -0
- package/konserve.compressor.js.map +1 -0
- package/konserve.core.js +8052 -0
- package/konserve.core.js.map +1 -0
- package/konserve.encryptor.js +553 -0
- package/konserve.encryptor.js.map +1 -0
- package/konserve.gc.js +541 -0
- package/konserve.gc.js.map +1 -0
- package/konserve.impl.defaults.js +8290 -0
- package/konserve.impl.defaults.js.map +1 -0
- package/konserve.impl.storage_layout.js +849 -0
- package/konserve.impl.storage_layout.js.map +1 -0
- package/konserve.memory.js +2102 -0
- package/konserve.memory.js.map +1 -0
- package/konserve.node_filestore.js +2951 -0
- package/konserve.node_filestore.js.map +1 -0
- package/konserve.protocols.js +590 -0
- package/konserve.protocols.js.map +1 -0
- package/konserve.serializers.js +562 -0
- package/konserve.serializers.js.map +1 -0
- package/konserve.store.js +2245 -0
- package/konserve.store.js.map +1 -0
- package/konserve.tiered.js +9574 -0
- package/konserve.tiered.js.map +1 -0
- package/konserve.utils.js +180 -0
- package/konserve.utils.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.arrays.js +66 -0
- package/me.tonsky.persistent_sorted_set.arrays.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.branch.js +2779 -0
- package/me.tonsky.persistent_sorted_set.branch.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.btset.js +14196 -0
- package/me.tonsky.persistent_sorted_set.btset.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.impl.node.js +324 -0
- package/me.tonsky.persistent_sorted_set.impl.node.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.impl.storage.js +123 -0
- package/me.tonsky.persistent_sorted_set.impl.storage.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.js +890 -0
- package/me.tonsky.persistent_sorted_set.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.leaf.js +561 -0
- package/me.tonsky.persistent_sorted_set.leaf.js.map +1 -0
- package/me.tonsky.persistent_sorted_set.util.js +402 -0
- package/me.tonsky.persistent_sorted_set.util.js.map +1 -0
- package/medley.core.js +1857 -0
- package/medley.core.js.map +1 -0
- package/package.json +38 -0
- package/spec_tools.core.js +1925 -0
- package/spec_tools.core.js.map +1 -0
- package/spec_tools.data_spec.js +1291 -0
- package/spec_tools.data_spec.js.map +1 -0
- package/spec_tools.form.js +185 -0
- package/spec_tools.form.js.map +1 -0
- package/spec_tools.impl.js +362 -0
- package/spec_tools.impl.js.map +1 -0
- package/spec_tools.parse.js +427 -0
- package/spec_tools.parse.js.map +1 -0
- package/spec_tools.transform.js +288 -0
- package/spec_tools.transform.js.map +1 -0
- package/superv.async.js +8617 -0
- package/superv.async.js.map +1 -0
- package/tailrecursion.priority_map.js +994 -0
- package/tailrecursion.priority_map.js.map +1 -0
- package/taoensso.encore.js +12385 -0
- package/taoensso.encore.js.map +1 -0
- package/taoensso.timbre.appenders.core.js +239 -0
- package/taoensso.timbre.appenders.core.js.map +1 -0
- package/taoensso.timbre.js +1264 -0
- package/taoensso.timbre.js.map +1 -0
- package/taoensso.truss.impl.js +442 -0
- package/taoensso.truss.impl.js.map +1 -0
- package/taoensso.truss.js +743 -0
- package/taoensso.truss.js.map +1 -0
- package/test-config-keys.js +33 -0
- package/test-final.js +36 -0
- package/test-key-duplication.js +67 -0
- package/test.js +557 -0
package/cljs.cache.js
ADDED
|
@@ -0,0 +1,1145 @@
|
|
|
1
|
+
var $CLJS = require("./cljs_env");
|
|
2
|
+
var $jscomp = $CLJS.$jscomp;
|
|
3
|
+
var COMPILED = false;
|
|
4
|
+
require("./cljs.core.js");
|
|
5
|
+
require("./tailrecursion.priority_map.js");
|
|
6
|
+
var environ=$CLJS.environ || ($CLJS.environ = {});
|
|
7
|
+
var fress=$CLJS.fress || ($CLJS.fress = {});
|
|
8
|
+
var datahike=$CLJS.datahike || ($CLJS.datahike = {});
|
|
9
|
+
var clojure=$CLJS.clojure || ($CLJS.clojure = {});
|
|
10
|
+
var hasch=$CLJS.hasch || ($CLJS.hasch = {});
|
|
11
|
+
var tailrecursion=$CLJS.tailrecursion || ($CLJS.tailrecursion = {});
|
|
12
|
+
var superv=$CLJS.superv || ($CLJS.superv = {});
|
|
13
|
+
var geheimnis=$CLJS.geheimnis || ($CLJS.geheimnis = {});
|
|
14
|
+
var is=$CLJS.is || ($CLJS.is = {});
|
|
15
|
+
var cljs=$CLJS.cljs || ($CLJS.cljs = {});
|
|
16
|
+
var cljs_node_io=$CLJS.cljs_node_io || ($CLJS.cljs_node_io = {});
|
|
17
|
+
var goog=$CLJS.goog || ($CLJS.goog = {});
|
|
18
|
+
var konserve=$CLJS.konserve || ($CLJS.konserve = {});
|
|
19
|
+
var datalog=$CLJS.datalog || ($CLJS.datalog = {});
|
|
20
|
+
var spec_tools=$CLJS.spec_tools || ($CLJS.spec_tools = {});
|
|
21
|
+
var taoensso=$CLJS.taoensso || ($CLJS.taoensso = {});
|
|
22
|
+
var incognito=$CLJS.incognito || ($CLJS.incognito = {});
|
|
23
|
+
var medley=$CLJS.medley || ($CLJS.medley = {});
|
|
24
|
+
var me=$CLJS.me || ($CLJS.me = {});
|
|
25
|
+
|
|
26
|
+
$CLJS.SHADOW_ENV.setLoaded("cljs.cache.js");
|
|
27
|
+
|
|
28
|
+
goog.provide('cljs.cache');
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* This is the protocol describing the basic cache capability.
|
|
32
|
+
* @interface
|
|
33
|
+
*/
|
|
34
|
+
cljs.cache.CacheProtocol = function(){};
|
|
35
|
+
|
|
36
|
+
var cljs$cache$CacheProtocol$lookup$dyn_45167 = (function() {
|
|
37
|
+
var G__45168 = null;
|
|
38
|
+
var G__45168__2 = (function (cache,e){
|
|
39
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
40
|
+
var m__5351__auto__ = (cljs.cache.lookup[goog.typeOf(x__5350__auto__)]);
|
|
41
|
+
if((!((m__5351__auto__ == null)))){
|
|
42
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5351__auto__.call(null, cache,e));
|
|
43
|
+
} else {
|
|
44
|
+
var m__5349__auto__ = (cljs.cache.lookup["_"]);
|
|
45
|
+
if((!((m__5349__auto__ == null)))){
|
|
46
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5349__auto__.call(null, cache,e));
|
|
47
|
+
} else {
|
|
48
|
+
throw cljs.core.missing_protocol("CacheProtocol.lookup",cache);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var G__45168__3 = (function (cache,e,not_found){
|
|
53
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
54
|
+
var m__5351__auto__ = (cljs.cache.lookup[goog.typeOf(x__5350__auto__)]);
|
|
55
|
+
if((!((m__5351__auto__ == null)))){
|
|
56
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$3(cache,e,not_found) : m__5351__auto__.call(null, cache,e,not_found));
|
|
57
|
+
} else {
|
|
58
|
+
var m__5349__auto__ = (cljs.cache.lookup["_"]);
|
|
59
|
+
if((!((m__5349__auto__ == null)))){
|
|
60
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$3(cache,e,not_found) : m__5349__auto__.call(null, cache,e,not_found));
|
|
61
|
+
} else {
|
|
62
|
+
throw cljs.core.missing_protocol("CacheProtocol.lookup",cache);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
G__45168 = function(cache,e,not_found){
|
|
67
|
+
switch(arguments.length){
|
|
68
|
+
case 2:
|
|
69
|
+
return G__45168__2.call(this,cache,e);
|
|
70
|
+
case 3:
|
|
71
|
+
return G__45168__3.call(this,cache,e,not_found);
|
|
72
|
+
}
|
|
73
|
+
throw(new Error('Invalid arity: ' + arguments.length));
|
|
74
|
+
};
|
|
75
|
+
G__45168.cljs$core$IFn$_invoke$arity$2 = G__45168__2;
|
|
76
|
+
G__45168.cljs$core$IFn$_invoke$arity$3 = G__45168__3;
|
|
77
|
+
return G__45168;
|
|
78
|
+
})()
|
|
79
|
+
;
|
|
80
|
+
/**
|
|
81
|
+
* Retrieve the value associated with `e` if it exists, else `nil` in
|
|
82
|
+
* the 2-arg case. Retrieve the value associated with `e` if it exists,
|
|
83
|
+
* else `not-found` in the 3-arg case.
|
|
84
|
+
*/
|
|
85
|
+
cljs.cache.lookup = (function cljs$cache$lookup(var_args){
|
|
86
|
+
var G__44624 = arguments.length;
|
|
87
|
+
switch (G__44624) {
|
|
88
|
+
case 2:
|
|
89
|
+
return cljs.cache.lookup.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
|
90
|
+
|
|
91
|
+
break;
|
|
92
|
+
case 3:
|
|
93
|
+
return cljs.cache.lookup.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
|
|
94
|
+
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
(cljs.cache.lookup.cljs$core$IFn$_invoke$arity$2 = (function (cache,e){
|
|
103
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$lookup$arity$2 == null)))))){
|
|
104
|
+
return cache.cljs$cache$CacheProtocol$lookup$arity$2(cache,e);
|
|
105
|
+
} else {
|
|
106
|
+
return cljs$cache$CacheProtocol$lookup$dyn_45167(cache,e);
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
(cljs.cache.lookup.cljs$core$IFn$_invoke$arity$3 = (function (cache,e,not_found){
|
|
111
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$lookup$arity$3 == null)))))){
|
|
112
|
+
return cache.cljs$cache$CacheProtocol$lookup$arity$3(cache,e,not_found);
|
|
113
|
+
} else {
|
|
114
|
+
return cljs$cache$CacheProtocol$lookup$dyn_45167(cache,e,not_found);
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
(cljs.cache.lookup.cljs$lang$maxFixedArity = 3);
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
var cljs$cache$CacheProtocol$has_QMARK_$dyn_45181 = (function (cache,e){
|
|
122
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
123
|
+
var m__5351__auto__ = (cljs.cache.has_QMARK_[goog.typeOf(x__5350__auto__)]);
|
|
124
|
+
if((!((m__5351__auto__ == null)))){
|
|
125
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5351__auto__.call(null, cache,e));
|
|
126
|
+
} else {
|
|
127
|
+
var m__5349__auto__ = (cljs.cache.has_QMARK_["_"]);
|
|
128
|
+
if((!((m__5349__auto__ == null)))){
|
|
129
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5349__auto__.call(null, cache,e));
|
|
130
|
+
} else {
|
|
131
|
+
throw cljs.core.missing_protocol("CacheProtocol.has?",cache);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Checks if the cache contains a value associated with `e`
|
|
137
|
+
*/
|
|
138
|
+
cljs.cache.has_QMARK_ = (function cljs$cache$has_QMARK_(cache,e){
|
|
139
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$has_QMARK_$arity$2 == null)))))){
|
|
140
|
+
return cache.cljs$cache$CacheProtocol$has_QMARK_$arity$2(cache,e);
|
|
141
|
+
} else {
|
|
142
|
+
return cljs$cache$CacheProtocol$has_QMARK_$dyn_45181(cache,e);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
var cljs$cache$CacheProtocol$hit$dyn_45185 = (function (cache,e){
|
|
147
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
148
|
+
var m__5351__auto__ = (cljs.cache.hit[goog.typeOf(x__5350__auto__)]);
|
|
149
|
+
if((!((m__5351__auto__ == null)))){
|
|
150
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5351__auto__.call(null, cache,e));
|
|
151
|
+
} else {
|
|
152
|
+
var m__5349__auto__ = (cljs.cache.hit["_"]);
|
|
153
|
+
if((!((m__5349__auto__ == null)))){
|
|
154
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5349__auto__.call(null, cache,e));
|
|
155
|
+
} else {
|
|
156
|
+
throw cljs.core.missing_protocol("CacheProtocol.hit",cache);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
/**
|
|
161
|
+
* Is meant to be called if the cache is determined to contain a value
|
|
162
|
+
* associated with `e`
|
|
163
|
+
*/
|
|
164
|
+
cljs.cache.hit = (function cljs$cache$hit(cache,e){
|
|
165
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$hit$arity$2 == null)))))){
|
|
166
|
+
return cache.cljs$cache$CacheProtocol$hit$arity$2(cache,e);
|
|
167
|
+
} else {
|
|
168
|
+
return cljs$cache$CacheProtocol$hit$dyn_45185(cache,e);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
var cljs$cache$CacheProtocol$miss$dyn_45191 = (function (cache,e,ret){
|
|
173
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
174
|
+
var m__5351__auto__ = (cljs.cache.miss[goog.typeOf(x__5350__auto__)]);
|
|
175
|
+
if((!((m__5351__auto__ == null)))){
|
|
176
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$3(cache,e,ret) : m__5351__auto__.call(null, cache,e,ret));
|
|
177
|
+
} else {
|
|
178
|
+
var m__5349__auto__ = (cljs.cache.miss["_"]);
|
|
179
|
+
if((!((m__5349__auto__ == null)))){
|
|
180
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$3 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$3(cache,e,ret) : m__5349__auto__.call(null, cache,e,ret));
|
|
181
|
+
} else {
|
|
182
|
+
throw cljs.core.missing_protocol("CacheProtocol.miss",cache);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
/**
|
|
187
|
+
* Is meant to be called if the cache is determined to **not** contain a
|
|
188
|
+
* value associated with `e`
|
|
189
|
+
*/
|
|
190
|
+
cljs.cache.miss = (function cljs$cache$miss(cache,e,ret){
|
|
191
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$miss$arity$3 == null)))))){
|
|
192
|
+
return cache.cljs$cache$CacheProtocol$miss$arity$3(cache,e,ret);
|
|
193
|
+
} else {
|
|
194
|
+
return cljs$cache$CacheProtocol$miss$dyn_45191(cache,e,ret);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
var cljs$cache$CacheProtocol$evict$dyn_45195 = (function (cache,e){
|
|
199
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
200
|
+
var m__5351__auto__ = (cljs.cache.evict[goog.typeOf(x__5350__auto__)]);
|
|
201
|
+
if((!((m__5351__auto__ == null)))){
|
|
202
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5351__auto__.call(null, cache,e));
|
|
203
|
+
} else {
|
|
204
|
+
var m__5349__auto__ = (cljs.cache.evict["_"]);
|
|
205
|
+
if((!((m__5349__auto__ == null)))){
|
|
206
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(cache,e) : m__5349__auto__.call(null, cache,e));
|
|
207
|
+
} else {
|
|
208
|
+
throw cljs.core.missing_protocol("CacheProtocol.evict",cache);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* Removes an entry from the cache
|
|
214
|
+
*/
|
|
215
|
+
cljs.cache.evict = (function cljs$cache$evict(cache,e){
|
|
216
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$evict$arity$2 == null)))))){
|
|
217
|
+
return cache.cljs$cache$CacheProtocol$evict$arity$2(cache,e);
|
|
218
|
+
} else {
|
|
219
|
+
return cljs$cache$CacheProtocol$evict$dyn_45195(cache,e);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
var cljs$cache$CacheProtocol$seed$dyn_45197 = (function (cache,base){
|
|
224
|
+
var x__5350__auto__ = (((cache == null))?null:cache);
|
|
225
|
+
var m__5351__auto__ = (cljs.cache.seed[goog.typeOf(x__5350__auto__)]);
|
|
226
|
+
if((!((m__5351__auto__ == null)))){
|
|
227
|
+
return (m__5351__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5351__auto__.cljs$core$IFn$_invoke$arity$2(cache,base) : m__5351__auto__.call(null, cache,base));
|
|
228
|
+
} else {
|
|
229
|
+
var m__5349__auto__ = (cljs.cache.seed["_"]);
|
|
230
|
+
if((!((m__5349__auto__ == null)))){
|
|
231
|
+
return (m__5349__auto__.cljs$core$IFn$_invoke$arity$2 ? m__5349__auto__.cljs$core$IFn$_invoke$arity$2(cache,base) : m__5349__auto__.call(null, cache,base));
|
|
232
|
+
} else {
|
|
233
|
+
throw cljs.core.missing_protocol("CacheProtocol.seed",cache);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
/**
|
|
238
|
+
* Is used to signal that the cache should be created with a seed.
|
|
239
|
+
* The contract is that said cache should return an instance of its
|
|
240
|
+
* own type.
|
|
241
|
+
*/
|
|
242
|
+
cljs.cache.seed = (function cljs$cache$seed(cache,base){
|
|
243
|
+
if((((!((cache == null)))) && ((!((cache.cljs$cache$CacheProtocol$seed$arity$2 == null)))))){
|
|
244
|
+
return cache.cljs$cache$CacheProtocol$seed$arity$2(cache,base);
|
|
245
|
+
} else {
|
|
246
|
+
return cljs$cache$CacheProtocol$seed$dyn_45197(cache,base);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
cljs.cache.default_wrapper_fn = (function cljs$cache$default_wrapper_fn(p1__44672_SHARP_,p2__44673_SHARP_){
|
|
251
|
+
return (p1__44672_SHARP_.cljs$core$IFn$_invoke$arity$1 ? p1__44672_SHARP_.cljs$core$IFn$_invoke$arity$1(p2__44673_SHARP_) : p1__44672_SHARP_.call(null, p2__44673_SHARP_));
|
|
252
|
+
});
|
|
253
|
+
/**
|
|
254
|
+
* The basic hit/miss logic for the cache system. Expects a wrap function and
|
|
255
|
+
* value function. The wrap function takes the value function and the item in
|
|
256
|
+
* question and is expected to run the value function with the item whenever a
|
|
257
|
+
* cache miss occurs. The intent is to hide any cache-specific cells from
|
|
258
|
+
* leaking into the cache logic itelf.
|
|
259
|
+
*/
|
|
260
|
+
cljs.cache.through = (function cljs$cache$through(var_args){
|
|
261
|
+
var G__44679 = arguments.length;
|
|
262
|
+
switch (G__44679) {
|
|
263
|
+
case 2:
|
|
264
|
+
return cljs.cache.through.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
|
265
|
+
|
|
266
|
+
break;
|
|
267
|
+
case 3:
|
|
268
|
+
return cljs.cache.through.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
|
|
269
|
+
|
|
270
|
+
break;
|
|
271
|
+
case 4:
|
|
272
|
+
return cljs.cache.through.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));
|
|
273
|
+
|
|
274
|
+
break;
|
|
275
|
+
default:
|
|
276
|
+
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
(cljs.cache.through.cljs$core$IFn$_invoke$arity$2 = (function (cache,item){
|
|
282
|
+
return cljs.cache.through.cljs$core$IFn$_invoke$arity$4(cljs.cache.default_wrapper_fn,cljs.core.identity,cache,item);
|
|
283
|
+
}));
|
|
284
|
+
|
|
285
|
+
(cljs.cache.through.cljs$core$IFn$_invoke$arity$3 = (function (value_fn,cache,item){
|
|
286
|
+
return cljs.cache.through.cljs$core$IFn$_invoke$arity$4(cljs.cache.default_wrapper_fn,value_fn,cache,item);
|
|
287
|
+
}));
|
|
288
|
+
|
|
289
|
+
(cljs.cache.through.cljs$core$IFn$_invoke$arity$4 = (function (wrap_fn,value_fn,cache,item){
|
|
290
|
+
if(cljs.core.truth_(cljs.cache.has_QMARK_(cache,item))){
|
|
291
|
+
return cljs.cache.hit(cache,item);
|
|
292
|
+
} else {
|
|
293
|
+
return cljs.cache.miss(cache,item,(function (){var G__44682 = (function (p1__44676_SHARP_){
|
|
294
|
+
return (value_fn.cljs$core$IFn$_invoke$arity$1 ? value_fn.cljs$core$IFn$_invoke$arity$1(p1__44676_SHARP_) : value_fn.call(null, p1__44676_SHARP_));
|
|
295
|
+
});
|
|
296
|
+
var G__44683 = item;
|
|
297
|
+
return (wrap_fn.cljs$core$IFn$_invoke$arity$2 ? wrap_fn.cljs$core$IFn$_invoke$arity$2(G__44682,G__44683) : wrap_fn.call(null, G__44682,G__44683));
|
|
298
|
+
})());
|
|
299
|
+
}
|
|
300
|
+
}));
|
|
301
|
+
|
|
302
|
+
(cljs.cache.through.cljs$lang$maxFixedArity = 4);
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* The basic hit/miss logic for the cache system. Like through but always has
|
|
306
|
+
* the cache argument in the first position for easier use with swap! etc.
|
|
307
|
+
*/
|
|
308
|
+
cljs.cache.through_cache = (function cljs$cache$through_cache(var_args){
|
|
309
|
+
var G__44692 = arguments.length;
|
|
310
|
+
switch (G__44692) {
|
|
311
|
+
case 2:
|
|
312
|
+
return cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
|
|
313
|
+
|
|
314
|
+
break;
|
|
315
|
+
case 3:
|
|
316
|
+
return cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));
|
|
317
|
+
|
|
318
|
+
break;
|
|
319
|
+
case 4:
|
|
320
|
+
return cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$4((arguments[(0)]),(arguments[(1)]),(arguments[(2)]),(arguments[(3)]));
|
|
321
|
+
|
|
322
|
+
break;
|
|
323
|
+
default:
|
|
324
|
+
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
(cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$2 = (function (cache,item){
|
|
330
|
+
return cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$4(cache,item,cljs.cache.default_wrapper_fn,cljs.core.identity);
|
|
331
|
+
}));
|
|
332
|
+
|
|
333
|
+
(cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$3 = (function (cache,item,value_fn){
|
|
334
|
+
return cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$4(cache,item,cljs.cache.default_wrapper_fn,value_fn);
|
|
335
|
+
}));
|
|
336
|
+
|
|
337
|
+
(cljs.cache.through_cache.cljs$core$IFn$_invoke$arity$4 = (function (cache,item,wrap_fn,value_fn){
|
|
338
|
+
if(cljs.core.truth_(cljs.cache.has_QMARK_(cache,item))){
|
|
339
|
+
return cljs.cache.hit(cache,item);
|
|
340
|
+
} else {
|
|
341
|
+
return cljs.cache.miss(cache,item,(function (){var G__44703 = (function (p1__44686_SHARP_){
|
|
342
|
+
return (value_fn.cljs$core$IFn$_invoke$arity$1 ? value_fn.cljs$core$IFn$_invoke$arity$1(p1__44686_SHARP_) : value_fn.call(null, p1__44686_SHARP_));
|
|
343
|
+
});
|
|
344
|
+
var G__44704 = item;
|
|
345
|
+
return (wrap_fn.cljs$core$IFn$_invoke$arity$2 ? wrap_fn.cljs$core$IFn$_invoke$arity$2(G__44703,G__44704) : wrap_fn.call(null, G__44703,G__44704));
|
|
346
|
+
})());
|
|
347
|
+
}
|
|
348
|
+
}));
|
|
349
|
+
|
|
350
|
+
(cljs.cache.through_cache.cljs$lang$maxFixedArity = 4);
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @constructor
|
|
355
|
+
* @implements {cljs.core.IEquiv}
|
|
356
|
+
* @implements {cljs.core.ICollection}
|
|
357
|
+
* @implements {cljs.core.IEmptyableCollection}
|
|
358
|
+
* @implements {cljs.core.ICounted}
|
|
359
|
+
* @implements {cljs.cache.CacheProtocol}
|
|
360
|
+
* @implements {cljs.core.ISeqable}
|
|
361
|
+
* @implements {cljs.core.IIterable}
|
|
362
|
+
* @implements {cljs.core.IAssociative}
|
|
363
|
+
* @implements {cljs.core.IMap}
|
|
364
|
+
* @implements {cljs.core.ILookup}
|
|
365
|
+
*/
|
|
366
|
+
cljs.cache.BasicCache = (function (cache){
|
|
367
|
+
this.cache = cache;
|
|
368
|
+
this.cljs$lang$protocol_mask$partition0$ = 10487566;
|
|
369
|
+
this.cljs$lang$protocol_mask$partition1$ = 131072;
|
|
370
|
+
});
|
|
371
|
+
(cljs.cache.BasicCache.prototype.toString = (function (){
|
|
372
|
+
var self__ = this;
|
|
373
|
+
var _ = this;
|
|
374
|
+
return cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.cache);
|
|
375
|
+
}));
|
|
376
|
+
|
|
377
|
+
(cljs.cache.BasicCache.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__44459__auto__,other__44466__auto__){
|
|
378
|
+
var self__ = this;
|
|
379
|
+
var this__44459__auto____$1 = this;
|
|
380
|
+
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(other__44466__auto__,self__.cache);
|
|
381
|
+
}));
|
|
382
|
+
|
|
383
|
+
(cljs.cache.BasicCache.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__44459__auto__,elem__44465__auto__){
|
|
384
|
+
var self__ = this;
|
|
385
|
+
var this__44459__auto____$1 = this;
|
|
386
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$seed$arity$2(null, (function (){var fexpr__44725 = new cljs.core.Symbol("cljs.cache","-conj","cljs.cache/-conj",837886777,null);
|
|
387
|
+
return (fexpr__44725.cljs$core$IFn$_invoke$arity$2 ? fexpr__44725.cljs$core$IFn$_invoke$arity$2(self__.cache,elem__44465__auto__) : fexpr__44725.call(null, self__.cache,elem__44465__auto__));
|
|
388
|
+
})());
|
|
389
|
+
}));
|
|
390
|
+
|
|
391
|
+
(cljs.cache.BasicCache.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = (function (this__44459__auto__){
|
|
392
|
+
var self__ = this;
|
|
393
|
+
var this__44459__auto____$1 = this;
|
|
394
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$seed$arity$2(null, (function (){var fexpr__44730 = new cljs.core.Symbol("cljs.cache","-empty","cljs.cache/-empty",-190310872,null);
|
|
395
|
+
return (fexpr__44730.cljs$core$IFn$_invoke$arity$1 ? fexpr__44730.cljs$core$IFn$_invoke$arity$1(self__.cache) : fexpr__44730.call(null, self__.cache));
|
|
396
|
+
})());
|
|
397
|
+
}));
|
|
398
|
+
|
|
399
|
+
(cljs.cache.BasicCache.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__44459__auto__){
|
|
400
|
+
var self__ = this;
|
|
401
|
+
var this__44459__auto____$1 = this;
|
|
402
|
+
return cljs.core._count(self__.cache);
|
|
403
|
+
}));
|
|
404
|
+
|
|
405
|
+
(cljs.cache.BasicCache.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (___44462__auto__){
|
|
406
|
+
var self__ = this;
|
|
407
|
+
var ___44462__auto____$1 = this;
|
|
408
|
+
return cljs.core._seq(self__.cache);
|
|
409
|
+
}));
|
|
410
|
+
|
|
411
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$ = cljs.core.PROTOCOL_SENTINEL);
|
|
412
|
+
|
|
413
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$lookup$arity$2 = (function (_,item){
|
|
414
|
+
var self__ = this;
|
|
415
|
+
var ___$1 = this;
|
|
416
|
+
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(self__.cache,item);
|
|
417
|
+
}));
|
|
418
|
+
|
|
419
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$lookup$arity$3 = (function (_,item,not_found){
|
|
420
|
+
var self__ = this;
|
|
421
|
+
var ___$1 = this;
|
|
422
|
+
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.cache,item,not_found);
|
|
423
|
+
}));
|
|
424
|
+
|
|
425
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$has_QMARK_$arity$2 = (function (_,item){
|
|
426
|
+
var self__ = this;
|
|
427
|
+
var ___$1 = this;
|
|
428
|
+
return cljs.core.contains_QMARK_(self__.cache,item);
|
|
429
|
+
}));
|
|
430
|
+
|
|
431
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$hit$arity$2 = (function (this$,item){
|
|
432
|
+
var self__ = this;
|
|
433
|
+
var this$__$1 = this;
|
|
434
|
+
return this$__$1;
|
|
435
|
+
}));
|
|
436
|
+
|
|
437
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$miss$arity$3 = (function (_,item,result){
|
|
438
|
+
var self__ = this;
|
|
439
|
+
var ___$1 = this;
|
|
440
|
+
return (new cljs.cache.BasicCache(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.cache,item,result)));
|
|
441
|
+
}));
|
|
442
|
+
|
|
443
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$evict$arity$2 = (function (_,key){
|
|
444
|
+
var self__ = this;
|
|
445
|
+
var ___$1 = this;
|
|
446
|
+
return (new cljs.cache.BasicCache(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.cache,key)));
|
|
447
|
+
}));
|
|
448
|
+
|
|
449
|
+
(cljs.cache.BasicCache.prototype.cljs$cache$CacheProtocol$seed$arity$2 = (function (_,base){
|
|
450
|
+
var self__ = this;
|
|
451
|
+
var ___$1 = this;
|
|
452
|
+
return (new cljs.cache.BasicCache(base));
|
|
453
|
+
}));
|
|
454
|
+
|
|
455
|
+
(cljs.cache.BasicCache.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (___44462__auto__){
|
|
456
|
+
var self__ = this;
|
|
457
|
+
var ___44462__auto____$1 = this;
|
|
458
|
+
return self__.cache.iterator();
|
|
459
|
+
}));
|
|
460
|
+
|
|
461
|
+
(cljs.cache.BasicCache.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__44459__auto__,k__44463__auto__,v__44464__auto__){
|
|
462
|
+
var self__ = this;
|
|
463
|
+
var this__44459__auto____$1 = this;
|
|
464
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$miss$arity$3(null, k__44463__auto__,v__44464__auto__);
|
|
465
|
+
}));
|
|
466
|
+
|
|
467
|
+
(cljs.cache.BasicCache.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__44459__auto__,k__44463__auto__){
|
|
468
|
+
var self__ = this;
|
|
469
|
+
var this__44459__auto____$1 = this;
|
|
470
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, k__44463__auto__);
|
|
471
|
+
}));
|
|
472
|
+
|
|
473
|
+
(cljs.cache.BasicCache.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__44459__auto__,k__44463__auto__){
|
|
474
|
+
var self__ = this;
|
|
475
|
+
var this__44459__auto____$1 = this;
|
|
476
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$evict$arity$2(null, k__44463__auto__);
|
|
477
|
+
}));
|
|
478
|
+
|
|
479
|
+
(cljs.cache.BasicCache.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__44459__auto__,key__44460__auto__){
|
|
480
|
+
var self__ = this;
|
|
481
|
+
var this__44459__auto____$1 = this;
|
|
482
|
+
return this__44459__auto____$1.cljs$core$ILookup$_lookup$arity$3(null, key__44460__auto__,null);
|
|
483
|
+
}));
|
|
484
|
+
|
|
485
|
+
(cljs.cache.BasicCache.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__44459__auto__,key__44460__auto__,not_found__44461__auto__){
|
|
486
|
+
var self__ = this;
|
|
487
|
+
var this__44459__auto____$1 = this;
|
|
488
|
+
if(cljs.core.truth_(this__44459__auto____$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, key__44460__auto__))){
|
|
489
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$lookup$arity$2(null, key__44460__auto__);
|
|
490
|
+
} else {
|
|
491
|
+
return not_found__44461__auto__;
|
|
492
|
+
}
|
|
493
|
+
}));
|
|
494
|
+
|
|
495
|
+
(cljs.cache.BasicCache.getBasis = (function (){
|
|
496
|
+
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"cache","cache",403508473,null)], null);
|
|
497
|
+
}));
|
|
498
|
+
|
|
499
|
+
(cljs.cache.BasicCache.cljs$lang$type = true);
|
|
500
|
+
|
|
501
|
+
(cljs.cache.BasicCache.cljs$lang$ctorStr = "cljs.cache/BasicCache");
|
|
502
|
+
|
|
503
|
+
(cljs.cache.BasicCache.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
504
|
+
return cljs.core._write(writer__5288__auto__,"cljs.cache/BasicCache");
|
|
505
|
+
}));
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Positional factory function for cljs.cache/BasicCache.
|
|
509
|
+
*/
|
|
510
|
+
cljs.cache.__GT_BasicCache = (function cljs$cache$__GT_BasicCache(cache){
|
|
511
|
+
return (new cljs.cache.BasicCache(cache));
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
cljs.cache.get_time = (function cljs$cache$get_time(){
|
|
515
|
+
return (new Date()).getTime();
|
|
516
|
+
});
|
|
517
|
+
/**
|
|
518
|
+
* returns a fn that dissocs expired keys from a map
|
|
519
|
+
*/
|
|
520
|
+
cljs.cache.key_killer_fn = (function cljs$cache$key_killer_fn(ttl,expiry,now){
|
|
521
|
+
var ks = cljs.core.map.cljs$core$IFn$_invoke$arity$2(cljs.core.key,cljs.core.filter.cljs$core$IFn$_invoke$arity$2((function (p1__44782_SHARP_){
|
|
522
|
+
return ((now - cljs.core.val(p1__44782_SHARP_)) > expiry);
|
|
523
|
+
}),ttl));
|
|
524
|
+
return (function (p1__44783_SHARP_){
|
|
525
|
+
return cljs.core.apply.cljs$core$IFn$_invoke$arity$3(cljs.core.dissoc,p1__44783_SHARP_,ks);
|
|
526
|
+
});
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* @constructor
|
|
531
|
+
* @implements {cljs.core.IEquiv}
|
|
532
|
+
* @implements {cljs.core.ICollection}
|
|
533
|
+
* @implements {cljs.core.IEmptyableCollection}
|
|
534
|
+
* @implements {cljs.core.ICounted}
|
|
535
|
+
* @implements {cljs.cache.CacheProtocol}
|
|
536
|
+
* @implements {cljs.core.ISeqable}
|
|
537
|
+
* @implements {cljs.core.IIterable}
|
|
538
|
+
* @implements {cljs.core.IAssociative}
|
|
539
|
+
* @implements {cljs.core.IMap}
|
|
540
|
+
* @implements {cljs.core.ILookup}
|
|
541
|
+
*/
|
|
542
|
+
cljs.cache.TTLCache = (function (cache,ttl,ttl_ms){
|
|
543
|
+
this.cache = cache;
|
|
544
|
+
this.ttl = ttl;
|
|
545
|
+
this.ttl_ms = ttl_ms;
|
|
546
|
+
this.cljs$lang$protocol_mask$partition0$ = 10487566;
|
|
547
|
+
this.cljs$lang$protocol_mask$partition1$ = 131072;
|
|
548
|
+
});
|
|
549
|
+
(cljs.cache.TTLCache.prototype.toString = (function (){
|
|
550
|
+
var self__ = this;
|
|
551
|
+
var _ = this;
|
|
552
|
+
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.cache),","," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.ttl),","," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.ttl_ms)].join('');
|
|
553
|
+
}));
|
|
554
|
+
|
|
555
|
+
(cljs.cache.TTLCache.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__44459__auto__,other__44466__auto__){
|
|
556
|
+
var self__ = this;
|
|
557
|
+
var this__44459__auto____$1 = this;
|
|
558
|
+
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(other__44466__auto__,self__.cache);
|
|
559
|
+
}));
|
|
560
|
+
|
|
561
|
+
(cljs.cache.TTLCache.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__44459__auto__,elem__44465__auto__){
|
|
562
|
+
var self__ = this;
|
|
563
|
+
var this__44459__auto____$1 = this;
|
|
564
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$seed$arity$2(null, (function (){var fexpr__44800 = new cljs.core.Symbol("cljs.cache","-conj","cljs.cache/-conj",837886777,null);
|
|
565
|
+
return (fexpr__44800.cljs$core$IFn$_invoke$arity$2 ? fexpr__44800.cljs$core$IFn$_invoke$arity$2(self__.cache,elem__44465__auto__) : fexpr__44800.call(null, self__.cache,elem__44465__auto__));
|
|
566
|
+
})());
|
|
567
|
+
}));
|
|
568
|
+
|
|
569
|
+
(cljs.cache.TTLCache.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = (function (this__44459__auto__){
|
|
570
|
+
var self__ = this;
|
|
571
|
+
var this__44459__auto____$1 = this;
|
|
572
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$seed$arity$2(null, (function (){var fexpr__44802 = new cljs.core.Symbol("cljs.cache","-empty","cljs.cache/-empty",-190310872,null);
|
|
573
|
+
return (fexpr__44802.cljs$core$IFn$_invoke$arity$1 ? fexpr__44802.cljs$core$IFn$_invoke$arity$1(self__.cache) : fexpr__44802.call(null, self__.cache));
|
|
574
|
+
})());
|
|
575
|
+
}));
|
|
576
|
+
|
|
577
|
+
(cljs.cache.TTLCache.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__44459__auto__){
|
|
578
|
+
var self__ = this;
|
|
579
|
+
var this__44459__auto____$1 = this;
|
|
580
|
+
return cljs.core._count(self__.cache);
|
|
581
|
+
}));
|
|
582
|
+
|
|
583
|
+
(cljs.cache.TTLCache.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (___44462__auto__){
|
|
584
|
+
var self__ = this;
|
|
585
|
+
var ___44462__auto____$1 = this;
|
|
586
|
+
return cljs.core._seq(self__.cache);
|
|
587
|
+
}));
|
|
588
|
+
|
|
589
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$ = cljs.core.PROTOCOL_SENTINEL);
|
|
590
|
+
|
|
591
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$lookup$arity$2 = (function (this$,item){
|
|
592
|
+
var self__ = this;
|
|
593
|
+
var this$__$1 = this;
|
|
594
|
+
var ret = this$__$1.cljs$cache$CacheProtocol$lookup$arity$3(null, item,new cljs.core.Keyword("cljs.cache","nope","cljs.cache/nope",968062453));
|
|
595
|
+
if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(ret,new cljs.core.Keyword("cljs.cache","nope","cljs.cache/nope",968062453))){
|
|
596
|
+
return null;
|
|
597
|
+
} else {
|
|
598
|
+
return ret;
|
|
599
|
+
}
|
|
600
|
+
}));
|
|
601
|
+
|
|
602
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$lookup$arity$3 = (function (this$,item,not_found){
|
|
603
|
+
var self__ = this;
|
|
604
|
+
var this$__$1 = this;
|
|
605
|
+
if(cljs.core.truth_(this$__$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, item))){
|
|
606
|
+
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(self__.cache,item);
|
|
607
|
+
} else {
|
|
608
|
+
return not_found;
|
|
609
|
+
}
|
|
610
|
+
}));
|
|
611
|
+
|
|
612
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$has_QMARK_$arity$2 = (function (_,item){
|
|
613
|
+
var self__ = this;
|
|
614
|
+
var ___$1 = this;
|
|
615
|
+
var t = cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.ttl,item,(- self__.ttl_ms));
|
|
616
|
+
return ((cljs.cache.get_time() - t) < self__.ttl_ms);
|
|
617
|
+
}));
|
|
618
|
+
|
|
619
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$hit$arity$2 = (function (this$,item){
|
|
620
|
+
var self__ = this;
|
|
621
|
+
var this$__$1 = this;
|
|
622
|
+
return this$__$1;
|
|
623
|
+
}));
|
|
624
|
+
|
|
625
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$miss$arity$3 = (function (this$,item,result){
|
|
626
|
+
var self__ = this;
|
|
627
|
+
var this$__$1 = this;
|
|
628
|
+
var now = cljs.cache.get_time();
|
|
629
|
+
var kill_old = cljs.cache.key_killer_fn(self__.ttl,self__.ttl_ms,now);
|
|
630
|
+
return (new cljs.cache.TTLCache(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(kill_old(self__.cache),item,result),cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(kill_old(self__.ttl),item,now),self__.ttl_ms));
|
|
631
|
+
}));
|
|
632
|
+
|
|
633
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$seed$arity$2 = (function (_,base){
|
|
634
|
+
var self__ = this;
|
|
635
|
+
var ___$1 = this;
|
|
636
|
+
var now = cljs.cache.get_time();
|
|
637
|
+
return (new cljs.cache.TTLCache(base,cljs.core.into.cljs$core$IFn$_invoke$arity$2(cljs.core.PersistentArrayMap.EMPTY,(function (){var iter__5480__auto__ = (function cljs$cache$iter__44825(s__44826){
|
|
638
|
+
return (new cljs.core.LazySeq(null,(function (){
|
|
639
|
+
var s__44826__$1 = s__44826;
|
|
640
|
+
while(true){
|
|
641
|
+
var temp__5804__auto__ = cljs.core.seq(s__44826__$1);
|
|
642
|
+
if(temp__5804__auto__){
|
|
643
|
+
var s__44826__$2 = temp__5804__auto__;
|
|
644
|
+
if(cljs.core.chunked_seq_QMARK_(s__44826__$2)){
|
|
645
|
+
var c__5478__auto__ = cljs.core.chunk_first(s__44826__$2);
|
|
646
|
+
var size__5479__auto__ = cljs.core.count(c__5478__auto__);
|
|
647
|
+
var b__44828 = cljs.core.chunk_buffer(size__5479__auto__);
|
|
648
|
+
if((function (){var i__44827 = (0);
|
|
649
|
+
while(true){
|
|
650
|
+
if((i__44827 < size__5479__auto__)){
|
|
651
|
+
var x = cljs.core._nth(c__5478__auto__,i__44827);
|
|
652
|
+
cljs.core.chunk_append(b__44828,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.key(x),now], null));
|
|
653
|
+
|
|
654
|
+
var G__45245 = (i__44827 + (1));
|
|
655
|
+
i__44827 = G__45245;
|
|
656
|
+
continue;
|
|
657
|
+
} else {
|
|
658
|
+
return true;
|
|
659
|
+
}
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
})()){
|
|
663
|
+
return cljs.core.chunk_cons(cljs.core.chunk(b__44828),cljs$cache$iter__44825(cljs.core.chunk_rest(s__44826__$2)));
|
|
664
|
+
} else {
|
|
665
|
+
return cljs.core.chunk_cons(cljs.core.chunk(b__44828),null);
|
|
666
|
+
}
|
|
667
|
+
} else {
|
|
668
|
+
var x = cljs.core.first(s__44826__$2);
|
|
669
|
+
return cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.key(x),now], null),cljs$cache$iter__44825(cljs.core.rest(s__44826__$2)));
|
|
670
|
+
}
|
|
671
|
+
} else {
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
}),null,null));
|
|
677
|
+
});
|
|
678
|
+
return iter__5480__auto__(base);
|
|
679
|
+
})()),self__.ttl_ms));
|
|
680
|
+
}));
|
|
681
|
+
|
|
682
|
+
(cljs.cache.TTLCache.prototype.cljs$cache$CacheProtocol$evict$arity$2 = (function (_,key){
|
|
683
|
+
var self__ = this;
|
|
684
|
+
var ___$1 = this;
|
|
685
|
+
return (new cljs.cache.TTLCache(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.cache,key),cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.ttl,key),self__.ttl_ms));
|
|
686
|
+
}));
|
|
687
|
+
|
|
688
|
+
(cljs.cache.TTLCache.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (___44462__auto__){
|
|
689
|
+
var self__ = this;
|
|
690
|
+
var ___44462__auto____$1 = this;
|
|
691
|
+
return self__.cache.iterator();
|
|
692
|
+
}));
|
|
693
|
+
|
|
694
|
+
(cljs.cache.TTLCache.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__44459__auto__,k__44463__auto__,v__44464__auto__){
|
|
695
|
+
var self__ = this;
|
|
696
|
+
var this__44459__auto____$1 = this;
|
|
697
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$miss$arity$3(null, k__44463__auto__,v__44464__auto__);
|
|
698
|
+
}));
|
|
699
|
+
|
|
700
|
+
(cljs.cache.TTLCache.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__44459__auto__,k__44463__auto__){
|
|
701
|
+
var self__ = this;
|
|
702
|
+
var this__44459__auto____$1 = this;
|
|
703
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, k__44463__auto__);
|
|
704
|
+
}));
|
|
705
|
+
|
|
706
|
+
(cljs.cache.TTLCache.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__44459__auto__,k__44463__auto__){
|
|
707
|
+
var self__ = this;
|
|
708
|
+
var this__44459__auto____$1 = this;
|
|
709
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$evict$arity$2(null, k__44463__auto__);
|
|
710
|
+
}));
|
|
711
|
+
|
|
712
|
+
(cljs.cache.TTLCache.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__44459__auto__,key__44460__auto__){
|
|
713
|
+
var self__ = this;
|
|
714
|
+
var this__44459__auto____$1 = this;
|
|
715
|
+
return this__44459__auto____$1.cljs$core$ILookup$_lookup$arity$3(null, key__44460__auto__,null);
|
|
716
|
+
}));
|
|
717
|
+
|
|
718
|
+
(cljs.cache.TTLCache.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__44459__auto__,key__44460__auto__,not_found__44461__auto__){
|
|
719
|
+
var self__ = this;
|
|
720
|
+
var this__44459__auto____$1 = this;
|
|
721
|
+
if(cljs.core.truth_(this__44459__auto____$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, key__44460__auto__))){
|
|
722
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$lookup$arity$2(null, key__44460__auto__);
|
|
723
|
+
} else {
|
|
724
|
+
return not_found__44461__auto__;
|
|
725
|
+
}
|
|
726
|
+
}));
|
|
727
|
+
|
|
728
|
+
(cljs.cache.TTLCache.getBasis = (function (){
|
|
729
|
+
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"cache","cache",403508473,null),new cljs.core.Symbol(null,"ttl","ttl",525256409,null),new cljs.core.Symbol(null,"ttl-ms","ttl-ms",-1349172894,null)], null);
|
|
730
|
+
}));
|
|
731
|
+
|
|
732
|
+
(cljs.cache.TTLCache.cljs$lang$type = true);
|
|
733
|
+
|
|
734
|
+
(cljs.cache.TTLCache.cljs$lang$ctorStr = "cljs.cache/TTLCache");
|
|
735
|
+
|
|
736
|
+
(cljs.cache.TTLCache.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
737
|
+
return cljs.core._write(writer__5288__auto__,"cljs.cache/TTLCache");
|
|
738
|
+
}));
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Positional factory function for cljs.cache/TTLCache.
|
|
742
|
+
*/
|
|
743
|
+
cljs.cache.__GT_TTLCache = (function cljs$cache$__GT_TTLCache(cache,ttl,ttl_ms){
|
|
744
|
+
return (new cljs.cache.TTLCache(cache,ttl,ttl_ms));
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
cljs.cache.build_leastness_queue = (function cljs$cache$build_leastness_queue(base,limit,start_at){
|
|
748
|
+
return cljs.core.into.cljs$core$IFn$_invoke$arity$2(tailrecursion.priority_map.priority_map(),cljs.core.concat.cljs$core$IFn$_invoke$arity$2(cljs.core.take.cljs$core$IFn$_invoke$arity$2((limit - cljs.core.count(base)),(function (){var iter__5480__auto__ = (function cljs$cache$build_leastness_queue_$_iter__44848(s__44849){
|
|
749
|
+
return (new cljs.core.LazySeq(null,(function (){
|
|
750
|
+
var s__44849__$1 = s__44849;
|
|
751
|
+
while(true){
|
|
752
|
+
var temp__5804__auto__ = cljs.core.seq(s__44849__$1);
|
|
753
|
+
if(temp__5804__auto__){
|
|
754
|
+
var s__44849__$2 = temp__5804__auto__;
|
|
755
|
+
if(cljs.core.chunked_seq_QMARK_(s__44849__$2)){
|
|
756
|
+
var c__5478__auto__ = cljs.core.chunk_first(s__44849__$2);
|
|
757
|
+
var size__5479__auto__ = cljs.core.count(c__5478__auto__);
|
|
758
|
+
var b__44851 = cljs.core.chunk_buffer(size__5479__auto__);
|
|
759
|
+
if((function (){var i__44850 = (0);
|
|
760
|
+
while(true){
|
|
761
|
+
if((i__44850 < size__5479__auto__)){
|
|
762
|
+
var k = cljs.core._nth(c__5478__auto__,i__44850);
|
|
763
|
+
cljs.core.chunk_append(b__44851,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,k], null));
|
|
764
|
+
|
|
765
|
+
var G__45260 = (i__44850 + (1));
|
|
766
|
+
i__44850 = G__45260;
|
|
767
|
+
continue;
|
|
768
|
+
} else {
|
|
769
|
+
return true;
|
|
770
|
+
}
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
})()){
|
|
774
|
+
return cljs.core.chunk_cons(cljs.core.chunk(b__44851),cljs$cache$build_leastness_queue_$_iter__44848(cljs.core.chunk_rest(s__44849__$2)));
|
|
775
|
+
} else {
|
|
776
|
+
return cljs.core.chunk_cons(cljs.core.chunk(b__44851),null);
|
|
777
|
+
}
|
|
778
|
+
} else {
|
|
779
|
+
var k = cljs.core.first(s__44849__$2);
|
|
780
|
+
return cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,k], null),cljs$cache$build_leastness_queue_$_iter__44848(cljs.core.rest(s__44849__$2)));
|
|
781
|
+
}
|
|
782
|
+
} else {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
}),null,null));
|
|
788
|
+
});
|
|
789
|
+
return iter__5480__auto__(cljs.core.range.cljs$core$IFn$_invoke$arity$2((- limit),(0)));
|
|
790
|
+
})()),(function (){var iter__5480__auto__ = (function cljs$cache$build_leastness_queue_$_iter__44905(s__44906){
|
|
791
|
+
return (new cljs.core.LazySeq(null,(function (){
|
|
792
|
+
var s__44906__$1 = s__44906;
|
|
793
|
+
while(true){
|
|
794
|
+
var temp__5804__auto__ = cljs.core.seq(s__44906__$1);
|
|
795
|
+
if(temp__5804__auto__){
|
|
796
|
+
var s__44906__$2 = temp__5804__auto__;
|
|
797
|
+
if(cljs.core.chunked_seq_QMARK_(s__44906__$2)){
|
|
798
|
+
var c__5478__auto__ = cljs.core.chunk_first(s__44906__$2);
|
|
799
|
+
var size__5479__auto__ = cljs.core.count(c__5478__auto__);
|
|
800
|
+
var b__44908 = cljs.core.chunk_buffer(size__5479__auto__);
|
|
801
|
+
if((function (){var i__44907 = (0);
|
|
802
|
+
while(true){
|
|
803
|
+
if((i__44907 < size__5479__auto__)){
|
|
804
|
+
var vec__44914 = cljs.core._nth(c__5478__auto__,i__44907);
|
|
805
|
+
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__44914,(0),null);
|
|
806
|
+
var _ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__44914,(1),null);
|
|
807
|
+
cljs.core.chunk_append(b__44908,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,start_at], null));
|
|
808
|
+
|
|
809
|
+
var G__45267 = (i__44907 + (1));
|
|
810
|
+
i__44907 = G__45267;
|
|
811
|
+
continue;
|
|
812
|
+
} else {
|
|
813
|
+
return true;
|
|
814
|
+
}
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
})()){
|
|
818
|
+
return cljs.core.chunk_cons(cljs.core.chunk(b__44908),cljs$cache$build_leastness_queue_$_iter__44905(cljs.core.chunk_rest(s__44906__$2)));
|
|
819
|
+
} else {
|
|
820
|
+
return cljs.core.chunk_cons(cljs.core.chunk(b__44908),null);
|
|
821
|
+
}
|
|
822
|
+
} else {
|
|
823
|
+
var vec__44922 = cljs.core.first(s__44906__$2);
|
|
824
|
+
var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__44922,(0),null);
|
|
825
|
+
var _ = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__44922,(1),null);
|
|
826
|
+
return cljs.core.cons(new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [k,start_at], null),cljs$cache$build_leastness_queue_$_iter__44905(cljs.core.rest(s__44906__$2)));
|
|
827
|
+
}
|
|
828
|
+
} else {
|
|
829
|
+
return null;
|
|
830
|
+
}
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
833
|
+
}),null,null));
|
|
834
|
+
});
|
|
835
|
+
return iter__5480__auto__(base);
|
|
836
|
+
})()));
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* @constructor
|
|
841
|
+
* @implements {cljs.core.IEquiv}
|
|
842
|
+
* @implements {cljs.core.ICollection}
|
|
843
|
+
* @implements {cljs.core.IEmptyableCollection}
|
|
844
|
+
* @implements {cljs.core.ICounted}
|
|
845
|
+
* @implements {cljs.cache.CacheProtocol}
|
|
846
|
+
* @implements {cljs.core.ISeqable}
|
|
847
|
+
* @implements {cljs.core.IIterable}
|
|
848
|
+
* @implements {cljs.core.IAssociative}
|
|
849
|
+
* @implements {cljs.core.IMap}
|
|
850
|
+
* @implements {cljs.core.ILookup}
|
|
851
|
+
*/
|
|
852
|
+
cljs.cache.LRUCache = (function (cache,lru,tick,limit){
|
|
853
|
+
this.cache = cache;
|
|
854
|
+
this.lru = lru;
|
|
855
|
+
this.tick = tick;
|
|
856
|
+
this.limit = limit;
|
|
857
|
+
this.cljs$lang$protocol_mask$partition0$ = 10487566;
|
|
858
|
+
this.cljs$lang$protocol_mask$partition1$ = 131072;
|
|
859
|
+
});
|
|
860
|
+
(cljs.cache.LRUCache.prototype.toString = (function (){
|
|
861
|
+
var self__ = this;
|
|
862
|
+
var _ = this;
|
|
863
|
+
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.cache),","," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.lru),","," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.tick),","," ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.limit)].join('');
|
|
864
|
+
}));
|
|
865
|
+
|
|
866
|
+
(cljs.cache.LRUCache.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this__44459__auto__,other__44466__auto__){
|
|
867
|
+
var self__ = this;
|
|
868
|
+
var this__44459__auto____$1 = this;
|
|
869
|
+
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(other__44466__auto__,self__.cache);
|
|
870
|
+
}));
|
|
871
|
+
|
|
872
|
+
(cljs.cache.LRUCache.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__44459__auto__,elem__44465__auto__){
|
|
873
|
+
var self__ = this;
|
|
874
|
+
var this__44459__auto____$1 = this;
|
|
875
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$seed$arity$2(null, (function (){var fexpr__44946 = new cljs.core.Symbol("cljs.cache","-conj","cljs.cache/-conj",837886777,null);
|
|
876
|
+
return (fexpr__44946.cljs$core$IFn$_invoke$arity$2 ? fexpr__44946.cljs$core$IFn$_invoke$arity$2(self__.cache,elem__44465__auto__) : fexpr__44946.call(null, self__.cache,elem__44465__auto__));
|
|
877
|
+
})());
|
|
878
|
+
}));
|
|
879
|
+
|
|
880
|
+
(cljs.cache.LRUCache.prototype.cljs$core$IEmptyableCollection$_empty$arity$1 = (function (this__44459__auto__){
|
|
881
|
+
var self__ = this;
|
|
882
|
+
var this__44459__auto____$1 = this;
|
|
883
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$seed$arity$2(null, (function (){var fexpr__44952 = new cljs.core.Symbol("cljs.cache","-empty","cljs.cache/-empty",-190310872,null);
|
|
884
|
+
return (fexpr__44952.cljs$core$IFn$_invoke$arity$1 ? fexpr__44952.cljs$core$IFn$_invoke$arity$1(self__.cache) : fexpr__44952.call(null, self__.cache));
|
|
885
|
+
})());
|
|
886
|
+
}));
|
|
887
|
+
|
|
888
|
+
(cljs.cache.LRUCache.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__44459__auto__){
|
|
889
|
+
var self__ = this;
|
|
890
|
+
var this__44459__auto____$1 = this;
|
|
891
|
+
return cljs.core._count(self__.cache);
|
|
892
|
+
}));
|
|
893
|
+
|
|
894
|
+
(cljs.cache.LRUCache.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (___44462__auto__){
|
|
895
|
+
var self__ = this;
|
|
896
|
+
var ___44462__auto____$1 = this;
|
|
897
|
+
return cljs.core._seq(self__.cache);
|
|
898
|
+
}));
|
|
899
|
+
|
|
900
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$ = cljs.core.PROTOCOL_SENTINEL);
|
|
901
|
+
|
|
902
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$lookup$arity$2 = (function (_,item){
|
|
903
|
+
var self__ = this;
|
|
904
|
+
var ___$1 = this;
|
|
905
|
+
return cljs.core.get.cljs$core$IFn$_invoke$arity$2(self__.cache,item);
|
|
906
|
+
}));
|
|
907
|
+
|
|
908
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$lookup$arity$3 = (function (_,item,not_found){
|
|
909
|
+
var self__ = this;
|
|
910
|
+
var ___$1 = this;
|
|
911
|
+
return cljs.core.get.cljs$core$IFn$_invoke$arity$3(self__.cache,item,not_found);
|
|
912
|
+
}));
|
|
913
|
+
|
|
914
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$has_QMARK_$arity$2 = (function (_,item){
|
|
915
|
+
var self__ = this;
|
|
916
|
+
var ___$1 = this;
|
|
917
|
+
return cljs.core.contains_QMARK_(self__.cache,item);
|
|
918
|
+
}));
|
|
919
|
+
|
|
920
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$hit$arity$2 = (function (_,item){
|
|
921
|
+
var self__ = this;
|
|
922
|
+
var ___$1 = this;
|
|
923
|
+
var tick_PLUS_ = (self__.tick + (1));
|
|
924
|
+
return (new cljs.cache.LRUCache(self__.cache,((cljs.core.contains_QMARK_(self__.cache,item))?cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.lru,item,tick_PLUS_):self__.lru),tick_PLUS_,self__.limit));
|
|
925
|
+
}));
|
|
926
|
+
|
|
927
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$miss$arity$3 = (function (_,item,result){
|
|
928
|
+
var self__ = this;
|
|
929
|
+
var ___$1 = this;
|
|
930
|
+
var tick_PLUS_ = (self__.tick + (1));
|
|
931
|
+
if((cljs.core.count(self__.lru) >= self__.limit)){
|
|
932
|
+
var k = ((cljs.core.contains_QMARK_(self__.lru,item))?item:cljs.core.first(cljs.core.peek(self__.lru)));
|
|
933
|
+
var c = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.cache,k),item,result);
|
|
934
|
+
var l = cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.lru,k),item,tick_PLUS_);
|
|
935
|
+
return (new cljs.cache.LRUCache(c,l,tick_PLUS_,self__.limit));
|
|
936
|
+
} else {
|
|
937
|
+
return (new cljs.cache.LRUCache(cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.cache,item,result),cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(self__.lru,item,tick_PLUS_),tick_PLUS_,self__.limit));
|
|
938
|
+
}
|
|
939
|
+
}));
|
|
940
|
+
|
|
941
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$evict$arity$2 = (function (this$,key){
|
|
942
|
+
var self__ = this;
|
|
943
|
+
var this$__$1 = this;
|
|
944
|
+
if(cljs.core.contains_QMARK_(self__.cache,key)){
|
|
945
|
+
return (new cljs.cache.LRUCache(cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.cache,key),cljs.core.dissoc.cljs$core$IFn$_invoke$arity$2(self__.lru,key),(self__.tick + (1)),self__.limit));
|
|
946
|
+
} else {
|
|
947
|
+
return this$__$1;
|
|
948
|
+
}
|
|
949
|
+
}));
|
|
950
|
+
|
|
951
|
+
(cljs.cache.LRUCache.prototype.cljs$cache$CacheProtocol$seed$arity$2 = (function (_,base){
|
|
952
|
+
var self__ = this;
|
|
953
|
+
var ___$1 = this;
|
|
954
|
+
return (new cljs.cache.LRUCache(base,cljs.cache.build_leastness_queue(base,self__.limit,(0)),(0),self__.limit));
|
|
955
|
+
}));
|
|
956
|
+
|
|
957
|
+
(cljs.cache.LRUCache.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (___44462__auto__){
|
|
958
|
+
var self__ = this;
|
|
959
|
+
var ___44462__auto____$1 = this;
|
|
960
|
+
return self__.cache.iterator();
|
|
961
|
+
}));
|
|
962
|
+
|
|
963
|
+
(cljs.cache.LRUCache.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__44459__auto__,k__44463__auto__,v__44464__auto__){
|
|
964
|
+
var self__ = this;
|
|
965
|
+
var this__44459__auto____$1 = this;
|
|
966
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$miss$arity$3(null, k__44463__auto__,v__44464__auto__);
|
|
967
|
+
}));
|
|
968
|
+
|
|
969
|
+
(cljs.cache.LRUCache.prototype.cljs$core$IAssociative$_contains_key_QMARK_$arity$2 = (function (this__44459__auto__,k__44463__auto__){
|
|
970
|
+
var self__ = this;
|
|
971
|
+
var this__44459__auto____$1 = this;
|
|
972
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, k__44463__auto__);
|
|
973
|
+
}));
|
|
974
|
+
|
|
975
|
+
(cljs.cache.LRUCache.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__44459__auto__,k__44463__auto__){
|
|
976
|
+
var self__ = this;
|
|
977
|
+
var this__44459__auto____$1 = this;
|
|
978
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$evict$arity$2(null, k__44463__auto__);
|
|
979
|
+
}));
|
|
980
|
+
|
|
981
|
+
(cljs.cache.LRUCache.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__44459__auto__,key__44460__auto__){
|
|
982
|
+
var self__ = this;
|
|
983
|
+
var this__44459__auto____$1 = this;
|
|
984
|
+
return this__44459__auto____$1.cljs$core$ILookup$_lookup$arity$3(null, key__44460__auto__,null);
|
|
985
|
+
}));
|
|
986
|
+
|
|
987
|
+
(cljs.cache.LRUCache.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__44459__auto__,key__44460__auto__,not_found__44461__auto__){
|
|
988
|
+
var self__ = this;
|
|
989
|
+
var this__44459__auto____$1 = this;
|
|
990
|
+
if(cljs.core.truth_(this__44459__auto____$1.cljs$cache$CacheProtocol$has_QMARK_$arity$2(null, key__44460__auto__))){
|
|
991
|
+
return this__44459__auto____$1.cljs$cache$CacheProtocol$lookup$arity$2(null, key__44460__auto__);
|
|
992
|
+
} else {
|
|
993
|
+
return not_found__44461__auto__;
|
|
994
|
+
}
|
|
995
|
+
}));
|
|
996
|
+
|
|
997
|
+
(cljs.cache.LRUCache.getBasis = (function (){
|
|
998
|
+
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"cache","cache",403508473,null),new cljs.core.Symbol(null,"lru","lru",-315566379,null),new cljs.core.Symbol(null,"tick","tick",804644551,null),new cljs.core.Symbol(null,"limit","limit",284709164,null)], null);
|
|
999
|
+
}));
|
|
1000
|
+
|
|
1001
|
+
(cljs.cache.LRUCache.cljs$lang$type = true);
|
|
1002
|
+
|
|
1003
|
+
(cljs.cache.LRUCache.cljs$lang$ctorStr = "cljs.cache/LRUCache");
|
|
1004
|
+
|
|
1005
|
+
(cljs.cache.LRUCache.cljs$lang$ctorPrWriter = (function (this__5287__auto__,writer__5288__auto__,opt__5289__auto__){
|
|
1006
|
+
return cljs.core._write(writer__5288__auto__,"cljs.cache/LRUCache");
|
|
1007
|
+
}));
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Positional factory function for cljs.cache/LRUCache.
|
|
1011
|
+
*/
|
|
1012
|
+
cljs.cache.__GT_LRUCache = (function cljs$cache$__GT_LRUCache(cache,lru,tick,limit){
|
|
1013
|
+
return (new cljs.cache.LRUCache(cache,lru,tick,limit));
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Returns a pluggable basic cache initialied to `base`
|
|
1018
|
+
*/
|
|
1019
|
+
cljs.cache.basic_cache_factory = (function cljs$cache$basic_cache_factory(base){
|
|
1020
|
+
if(cljs.core.map_QMARK_(base)){
|
|
1021
|
+
} else {
|
|
1022
|
+
throw (new Error("Assert failed: (map? base)"));
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
return (new cljs.cache.BasicCache(base));
|
|
1026
|
+
});
|
|
1027
|
+
/**
|
|
1028
|
+
* Returns a TTL cache with the cache and expiration-table initialied to `base` --
|
|
1029
|
+
* each with the same time-to-live.
|
|
1030
|
+
*
|
|
1031
|
+
* This function also allows an optional `:ttl` argument that defines the default
|
|
1032
|
+
* time in milliseconds that entries are allowed to reside in the cache.
|
|
1033
|
+
*/
|
|
1034
|
+
cljs.cache.ttl_cache_factory = (function cljs$cache$ttl_cache_factory(var_args){
|
|
1035
|
+
var args__5732__auto__ = [];
|
|
1036
|
+
var len__5726__auto___45282 = arguments.length;
|
|
1037
|
+
var i__5727__auto___45284 = (0);
|
|
1038
|
+
while(true){
|
|
1039
|
+
if((i__5727__auto___45284 < len__5726__auto___45282)){
|
|
1040
|
+
args__5732__auto__.push((arguments[i__5727__auto___45284]));
|
|
1041
|
+
|
|
1042
|
+
var G__45285 = (i__5727__auto___45284 + (1));
|
|
1043
|
+
i__5727__auto___45284 = G__45285;
|
|
1044
|
+
continue;
|
|
1045
|
+
} else {
|
|
1046
|
+
}
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
|
|
1051
|
+
return cljs.cache.ttl_cache_factory.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
|
|
1052
|
+
});
|
|
1053
|
+
|
|
1054
|
+
(cljs.cache.ttl_cache_factory.cljs$core$IFn$_invoke$arity$variadic = (function (base,p__45102){
|
|
1055
|
+
var map__45103 = p__45102;
|
|
1056
|
+
var map__45103__$1 = cljs.core.__destructure_map(map__45103);
|
|
1057
|
+
var ttl = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__45103__$1,new cljs.core.Keyword(null,"ttl","ttl",-1115275118),(2000));
|
|
1058
|
+
if(typeof ttl === 'number'){
|
|
1059
|
+
} else {
|
|
1060
|
+
throw (new Error("Assert failed: (number? ttl)"));
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
if(((0) <= ttl)){
|
|
1064
|
+
} else {
|
|
1065
|
+
throw (new Error("Assert failed: (<= 0 ttl)"));
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
if(cljs.core.map_QMARK_(base)){
|
|
1069
|
+
} else {
|
|
1070
|
+
throw (new Error("Assert failed: (map? base)"));
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
return (new cljs.cache.TTLCache(cljs.core.PersistentArrayMap.EMPTY,cljs.core.PersistentArrayMap.EMPTY,ttl)).cljs$cache$CacheProtocol$seed$arity$2(null, base);
|
|
1074
|
+
}));
|
|
1075
|
+
|
|
1076
|
+
(cljs.cache.ttl_cache_factory.cljs$lang$maxFixedArity = (1));
|
|
1077
|
+
|
|
1078
|
+
/** @this {Function} */
|
|
1079
|
+
(cljs.cache.ttl_cache_factory.cljs$lang$applyTo = (function (seq45052){
|
|
1080
|
+
var G__45053 = cljs.core.first(seq45052);
|
|
1081
|
+
var seq45052__$1 = cljs.core.next(seq45052);
|
|
1082
|
+
var self__5711__auto__ = this;
|
|
1083
|
+
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__45053,seq45052__$1);
|
|
1084
|
+
}));
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Returns an LRU cache with the cache and usage-table initialied to `base` --
|
|
1088
|
+
* each entry is initialized with the same usage value.
|
|
1089
|
+
* This function takes an optional `:threshold` argument that defines the maximum number
|
|
1090
|
+
* of elements in the cache before the LRU semantics apply (default is 32).
|
|
1091
|
+
*/
|
|
1092
|
+
cljs.cache.lru_cache_factory = (function cljs$cache$lru_cache_factory(var_args){
|
|
1093
|
+
var args__5732__auto__ = [];
|
|
1094
|
+
var len__5726__auto___45287 = arguments.length;
|
|
1095
|
+
var i__5727__auto___45288 = (0);
|
|
1096
|
+
while(true){
|
|
1097
|
+
if((i__5727__auto___45288 < len__5726__auto___45287)){
|
|
1098
|
+
args__5732__auto__.push((arguments[i__5727__auto___45288]));
|
|
1099
|
+
|
|
1100
|
+
var G__45289 = (i__5727__auto___45288 + (1));
|
|
1101
|
+
i__5727__auto___45288 = G__45289;
|
|
1102
|
+
continue;
|
|
1103
|
+
} else {
|
|
1104
|
+
}
|
|
1105
|
+
break;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
var argseq__5733__auto__ = ((((1) < args__5732__auto__.length))?(new cljs.core.IndexedSeq(args__5732__auto__.slice((1)),(0),null)):null);
|
|
1109
|
+
return cljs.cache.lru_cache_factory.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),argseq__5733__auto__);
|
|
1110
|
+
});
|
|
1111
|
+
|
|
1112
|
+
(cljs.cache.lru_cache_factory.cljs$core$IFn$_invoke$arity$variadic = (function (base,p__45141){
|
|
1113
|
+
var map__45142 = p__45141;
|
|
1114
|
+
var map__45142__$1 = cljs.core.__destructure_map(map__45142);
|
|
1115
|
+
var threshold = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__45142__$1,new cljs.core.Keyword(null,"threshold","threshold",204221583),(32));
|
|
1116
|
+
if(typeof threshold === 'number'){
|
|
1117
|
+
} else {
|
|
1118
|
+
throw (new Error("Assert failed: (number? threshold)"));
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
if(((0) < threshold)){
|
|
1122
|
+
} else {
|
|
1123
|
+
throw (new Error("Assert failed: (< 0 threshold)"));
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
if(cljs.core.map_QMARK_(base)){
|
|
1127
|
+
} else {
|
|
1128
|
+
throw (new Error("Assert failed: (map? base)"));
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
return (new cljs.cache.LRUCache(cljs.core.PersistentArrayMap.EMPTY,tailrecursion.priority_map.priority_map(),(0),threshold)).cljs$cache$CacheProtocol$seed$arity$2(null, base);
|
|
1132
|
+
}));
|
|
1133
|
+
|
|
1134
|
+
(cljs.cache.lru_cache_factory.cljs$lang$maxFixedArity = (1));
|
|
1135
|
+
|
|
1136
|
+
/** @this {Function} */
|
|
1137
|
+
(cljs.cache.lru_cache_factory.cljs$lang$applyTo = (function (seq45129){
|
|
1138
|
+
var G__45130 = cljs.core.first(seq45129);
|
|
1139
|
+
var seq45129__$1 = cljs.core.next(seq45129);
|
|
1140
|
+
var self__5711__auto__ = this;
|
|
1141
|
+
return self__5711__auto__.cljs$core$IFn$_invoke$arity$variadic(G__45130,seq45129__$1);
|
|
1142
|
+
}));
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
//# sourceMappingURL=cljs.cache.js.map
|