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

Add record-type-parent definition.

* module/ice-9/boot-9.scm (record-type-parent): New definition.
This commit is contained in:
Andy Wingo 2019-10-29 10:34:35 +01:00
parent 315fabdfe7
commit 1ae0f8d490

View file

@ -1234,6 +1234,11 @@ VALUE."
(unless (record-type? rtd)
(error 'not-a-record-type rtd))
(struct-ref rtd (+ 4 vtable-offset-user)))
(define (record-type-parent rtd)
(let* ((parents (record-type-parents rtd))
(nparents (vector-length parents)))
(and (not (zero? nparents))
(vector-ref parents (1- nparents)))))
(define (record-type-mutable-fields rtd)
(unless (record-type? rtd)