Open kpoeck opened 4 years ago
This might not happen in all installations, e.g. drmeister does not seem to observe this
now gives: `(#:|4| #:|3| #:|2| #:|1| #:|0|)
NIL`
this seems to be correct
(progn
(defvar *key-store* nil)
(defvar *test-weak-table* (make-hash-table :test #'eq :weakness :key))
(dotimes (x 5)
(let ((sym (cons x x)))
(pushnew sym *key-store*)
(setf (gethash sym *test-weak-table*)(list x (1+ x)))))
(setq * nil ** nil *** nil)
(dotimes (x 10)(gctools:garbage-collect))
(pprint *key-store*)
(maphash #'(lambda(key value)
(print `(,key ,value))) *test-weak-table*)
(setq *key-store* nil)
(dotimes (x 10)(gctools:garbage-collect))
(maphash #'(lambda(key value)
(print `(,key ,value))) *test-weak-table*)
)
((4 . 4) (3 . 3) (2 . 2) (1 . 1) (0 . 0))
((3 . 3) (3 4))
((1 . 1) (1 2))
((2 . 2) (2 3))
((0 . 0) (0 1))
((4 . 4) (4 5))
NIL