simplify %condition-type-vtable
authorAndy Wingo <wingo@pobox.com>
Fri, 18 Nov 2011 10:35:07 +0000 (11:35 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 6 Jul 2012 16:32:14 +0000 (18:32 +0200)
* module/srfi/srfi-35.scm (%condition-type-vtable): Use make-vtable
  instead of make-vtable-vtable.

module/srfi/srfi-35.scm

index d2b9c94..8f86bce 100644 (file)
   ;; The vtable of all condition types.
   ;;   vtable fields: vtable, self, printer
   ;;   user fields:   id, parent, all-field-names
-  (make-vtable-vtable "prprpr" 0
-                     (lambda (ct port)
-                       (if (eq? ct %condition-type-vtable)
-                           (display "#<condition-type-vtable>")
-                           (format port "#<condition-type ~a ~a>"
-                                   (condition-type-id ct)
-                                   (number->string (object-address ct)
-                                                   16))))))
+  (let ((s (make-vtable (string-append standard-vtable-fields "prprpr")
+                        (lambda (ct port)
+                          (format port "#<condition-type ~a ~a>"
+                                  (condition-type-id ct)
+                                  (number->string (object-address ct)
+                                                  16))))))
+    (set-struct-vtable-name! s 'condition-type)
+    s))
 
 (define (%make-condition-type layout id parent all-fields)
   (let ((struct (make-struct %condition-type-vtable 0