mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 15:00:21 +02:00
Add record-type-parent definition.
* module/ice-9/boot-9.scm (record-type-parent): New definition.
This commit is contained in:
parent
315fabdfe7
commit
1ae0f8d490
1 changed files with 5 additions and 0 deletions
|
@ -1234,6 +1234,11 @@ VALUE."
|
||||||
(unless (record-type? rtd)
|
(unless (record-type? rtd)
|
||||||
(error 'not-a-record-type rtd))
|
(error 'not-a-record-type rtd))
|
||||||
(struct-ref rtd (+ 4 vtable-offset-user)))
|
(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)
|
(define (record-type-mutable-fields rtd)
|
||||||
(unless (record-type? rtd)
|
(unless (record-type? rtd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue