Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
Cloud & Deployment
Core Language & Structure
Data Manipulation & Analysis
Engineering Data & Computation
External Interfaces & Connections
Financial Data & Computation
Geographic Data & Computation
Geometry
Graphs & Networks
Higher Mathematical Computation
Images
Knowledge Representation & Natural Language
Machine Learning
Notebook Documents & Presentation
Scientific and Medical Data & Computation
Social, Cultural & Linguistic Data
Strings & Text
Symbolic & Numeric Computation
System Operation & Setup
Time-Related Computation
User Interface Construction
Visualization & Graphics
Random Paclet
Alphabetical List
Using Paclets
Create a Paclet
Get Started
Download Definition Notebook
Learn More about
Wolfram Language
WeakCache
Guides
Weak Cache Functions
Symbols
CheckWeakCache
CleanupAfter
ClearHistory
ClearWeakCache
CreateReference
SameInstanceQ
SetWeakCache
StrongReference
WeakHashTable
WeakReference
JasonB`WeakCache`
W
e
a
k
H
a
s
h
T
a
b
l
e
W
e
a
k
H
a
s
h
T
a
b
l
e
[
"
l
a
b
e
l
"
]
r
e
t
u
r
n
s
a
w
e
a
k
h
a
s
h
t
a
b
l
e
d
a
t
a
s
t
r
u
c
t
u
r
e
w
i
t
h
t
h
e
g
i
v
e
n
l
a
b
e
l
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
Examples
(
7
)
Basic Examples
(
1
)
As in many examples for this paclet, we set
$
H
i
s
t
o
r
y
L
e
n
g
t
h
to zero to avoid leaving strong references to expressions in the session history:
I
n
[
1
]
:
=
$
H
i
s
t
o
r
y
L
e
n
g
t
h
=
0
O
u
t
[
1
]
=
0
Create a new table and an expression:
I
n
[
2
]
:
=
t
a
b
l
e
=
W
e
a
k
H
a
s
h
T
a
b
l
e
[
"
e
x
a
m
p
l
e
t
a
b
l
e
1
"
]
O
u
t
[
2
]
=
W
e
a
k
H
a
s
h
T
a
b
l
e
e
x
a
m
p
l
e
t
a
b
l
e
1
I
n
[
3
]
:
=
e
x
p
r
=
R
a
n
d
o
m
I
m
a
g
e
[
4
]
O
u
t
[
3
]
=
Perform some expensive computation that you wish to cache:
I
n
[
4
]
:
=
(
d
a
t
a
=
I
m
a
g
e
K
e
y
p
o
i
n
t
s
[
e
x
p
r
]
)
/
/
S
h
a
l
l
o
w
/
/
R
e
p
e
a
t
e
d
T
i
m
i
n
g
O
u
t
[
4
]
=
{
0
.
0
0
5
2
5
4
4
1
,
{
{
8
8
.
1
8
1
6
,
7
7
.
1
0
3
5
}
,
{
2
1
.
5
7
8
7
,
7
5
.
5
1
6
5
}
,
{
3
4
.
8
5
9
2
,
1
5
.
4
4
4
2
}
,
{
9
4
.
7
8
9
5
,
1
0
9
.
7
6
7
}
,
{
2
2
.
5
3
1
8
,
1
5
.
3
4
3
1
}
,
{
4
9
.
9
0
1
9
,
3
7
.
2
9
9
2
}
,
{
1
1
4
.
6
5
9
,
7
9
.
3
8
7
2
}
,
{
5
8
.
3
2
1
4
,
6
3
.
6
8
8
1
}
,
{
5
8
.
3
3
2
8
,
3
1
.
0
2
7
4
}
,
{
6
6
.
9
1
1
1
,
9
7
.
8
0
3
3
}
,
8
7
}
}
Add the data to the table:
I
n
[
5
]
:
=
t
a
b
l
e
[
"
I
n
s
e
r
t
"
,
e
x
p
r
,
"
k
e
y
"
,
d
a
t
a
]
In the above we use
"
k
e
y
"
as the key - any expression can be used as a key, but using simple expressions like strings or symbols is best for efficiency. Verify that the data in the table is the same and that retrieving it is fast:
I
n
[
6
]
:
=
S
a
m
e
Q
[
d
a
t
a
,
t
a
b
l
e
[
"
L
o
o
k
u
p
"
,
e
x
p
r
,
"
k
e
y
"
]
]
/
/
R
e
p
e
a
t
e
d
T
i
m
i
n
g
O
u
t
[
6
]
=
{
3
.
1
2
6
7
8
×
-
6
1
0
,
T
r
u
e
}
Since the history is turned off
e
x
p
r
is the only reference to the image expression, deleting it will clear the table:
I
n
[
7
]
:
=
t
a
b
l
e
[
"
L
e
n
g
t
h
"
]
O
u
t
[
7
]
=
1
I
n
[
8
]
:
=
e
x
p
r
=
.
I
n
[
9
]
:
=
t
a
b
l
e
[
"
L
e
n
g
t
h
"
]
O
u
t
[
9
]
=
0
I
n
[
1
0
]
:
=
t
a
b
l
e
[
"
L
o
o
k
u
p
"
,
e
x
p
r
,
"
k
e
y
"
]
O
u
t
[
1
0
]
=
$
F
a
i
l
e
d
S
c
o
p
e
(
1
)
G
e
n
e
r
a
l
i
z
a
t
i
o
n
s
&
E
x
t
e
n
s
i
o
n
s
(
1
)
P
o
s
s
i
b
l
e
I
s
s
u
e
s
(
4
)
S
e
e
A
l
s
o
S
a
m
e
I
n
s
t
a
n
c
e
Q
▪
S
e
t
W
e
a
k
C
a
c
h
e
▪
C
h
e
c
k
W
e
a
k
C
a
c
h
e
▪
C
l
e
a
r
W
e
a
k
C
a
c
h
e
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
W
e
a
k
C
a
c
h
e
F
u
n
c
t
i
o
n
s
"
"