[slime-cvs] CVS slime

alendvai alendvai at common-lisp.net
Tue Dec 19 10:47:37 UTC 2006


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv19944

Modified Files:
	swank-allegro.lisp swank-backend.lisp swank-openmcl.lisp 
	swank-sbcl.lisp swank.lisp 
Log Message:
Added hash-table-weakness and use it in hash-table-inspecting


--- /project/slime/cvsroot/slime/swank-allegro.lisp	2006/11/19 21:33:03	1.94
+++ /project/slime/cvsroot/slime/swank-allegro.lisp	2006/12/19 10:47:36	1.95
@@ -764,6 +764,11 @@
 (defimplementation make-weak-value-hash-table (&rest args)
   (apply #'make-hash-table :values :weak args))
 
+(defimplementation hash-table-weakness (hashtable)
+  (cond ((excl:hash-table-weak-keys hashtable) :key)
+        ((eq (excl:hash-table-values hashtable) :weak) :value)))
+
+
 
 ;;;; Character names
 
--- /project/slime/cvsroot/slime/swank-backend.lisp	2006/12/12 15:40:23	1.112
+++ /project/slime/cvsroot/slime/swank-backend.lisp	2006/12/19 10:47:36	1.113
@@ -1015,6 +1015,11 @@
   "Like MAKE-HASH-TABLE, but weak w.r.t. the values."
   (apply #'make-hash-table args))
 
+(definterface hash-table-weakness (hashtable)
+  "Return nil or one of :key :value :key-or-value :key-and-value"
+  (declare (ignore hashtable))
+  nil)
+
 
 ;;;; Character names
 
--- /project/slime/cvsroot/slime/swank-openmcl.lisp	2006/11/19 21:33:03	1.113
+++ /project/slime/cvsroot/slime/swank-openmcl.lisp	2006/12/19 10:47:36	1.114
@@ -930,3 +930,5 @@
 (defimplementation make-weak-value-hash-table (&rest args)
   (apply #'make-hash-table :weak :value args))
 
+(defimplementation hash-table-weakness (hashtable)
+  (ccl::hash-table-weak-p ht))
--- /project/slime/cvsroot/slime/swank-sbcl.lisp	2006/12/05 04:46:06	1.172
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp	2006/12/19 10:47:36	1.173
@@ -1245,3 +1245,7 @@
   (apply #'make-hash-table :weakness :value args)
   #-#.(swank-backend::sbcl-with-weak-hash-tables)
   (apply #'make-hash-table args))
+
+(defimplementation hash-table-weakness (hashtable)
+  #+#.(swank-backend::sbcl-with-weak-hash-tables)
+  (sb-ext:hash-table-weakness hashtable))
--- /project/slime/cvsroot/slime/swank.lisp	2006/12/19 10:45:37	1.433
+++ /project/slime/cvsroot/slime/swank.lisp	2006/12/19 10:47:36	1.434
@@ -4186,6 +4186,9 @@
             ("Test" (hash-table-test ht))
             ("Rehash size" (hash-table-rehash-size ht))
             ("Rehash threshold" (hash-table-rehash-threshold ht)))
+           (let ((weakness (hash-table-weakness ht)))
+             (when weakness
+               `("Weakness: " (:value ,weakness) (:newline))))
            (unless (zerop (hash-table-count ht))
              `((:action "[clear hashtable]" ,(lambda () (clrhash ht))) (:newline)
                "Contents: " (:newline)))




More information about the slime-cvs mailing list