mirror of
https://github.com/janet-lang/janet
synced 2024-12-04 05:49:55 +00:00
84ad161f1e
Also change weak table syntax to not require keyword arguments.
21 lines
451 B
Plaintext
21 lines
451 B
Plaintext
(def weak-k (table/weak-keys 10))
|
|
(def weak-v (table/weak-values 10))
|
|
(def weak-kv (table/weak 10))
|
|
|
|
(put weak-kv (gensym) 10)
|
|
(put weak-kv :hello :world)
|
|
(put weak-k :abc123zz77asda :stuff)
|
|
(put weak-k true :abc123zz77asda)
|
|
(put weak-k :zyzzyz false)
|
|
(put weak-v (gensym) 10)
|
|
(put weak-v 20 (gensym))
|
|
(print "before gc")
|
|
(tracev weak-k)
|
|
(tracev weak-v)
|
|
(tracev weak-kv)
|
|
(gccollect)
|
|
(print "after gc")
|
|
(tracev weak-k)
|
|
(tracev weak-v)
|
|
(tracev weak-kv)
|