~ chicken-core (chicken-5) 9469cd87e18a957eaa4e8c829d9ce78151c62d6a


commit 9469cd87e18a957eaa4e8c829d9ce78151c62d6a
Author:     unknown <felix@.(none)>
AuthorDate: Mon Oct 26 15:21:06 2009 +0100
Commit:     Felix <bunny351@gmail.com>
CommitDate: Sun Nov 8 01:03:26 2009 +0100

    printer for hash-tables shows current size

diff --git a/srfi-69.scm b/srfi-69.scm
index 36ed0fbb..9144f837 100644
--- a/srfi-69.scm
+++ b/srfi-69.scm
@@ -1087,3 +1087,13 @@
   (##sys#check-structure ht 'hash-table 'hash-table-map)
   (##sys#check-closure func 'hash-table-map)
   (*hash-table-fold ht (lambda (k v a) (cons (func k v) a)) '()) )
+
+
+;;; printing
+
+(##sys#register-record-printer
+ 'hash-table
+ (lambda (ht port)
+   (##sys#print "#<hash-table (" #f port)
+   (##sys#print (##sys#slot ht 2) #f port)
+   (##sys#print ")>" #f port) ) )
Trap