1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

record-type-vtable is not a new root of the vtable hierarchy

* module/ice-9/boot-9.scm (record-type-vtable): Simplify to use
  make-vtable instead of make-vtable-vtable.
This commit is contained in:
Andy Wingo 2011-11-18 11:32:24 +01:00
parent fb5f79a8b0
commit f7bbc75d04

View file

@ -955,16 +955,13 @@ VALUE."
;; 0: type-name, 1: fields, 2: constructor
(define record-type-vtable
;; FIXME: This should just call make-vtable, not make-vtable-vtable; but for
;; that we need to expose the bare vtable-vtable to Scheme.
(make-vtable-vtable "prprpw" 0
(lambda (s p)
(cond ((eq? s record-type-vtable)
(display "#<record-type-vtable>" p))
(else
(display "#<record-type " p)
(display (record-type-name s) p)
(display ">" p))))))
(let ((s (make-vtable (string-append standard-vtable-fields "prprpw")
(lambda (s p)
(display "#<record-type " p)
(display (record-type-name s) p)
(display ">" p)))))
(set-struct-vtable-name! s 'record-type)
s))
(define (record-type? obj)
(and (struct? obj) (eq? record-type-vtable (struct-vtable obj))))