[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 05/06: Add record-type-parent definition.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 05/06: Add record-type-parent definition. |
Date: |
Tue, 29 Oct 2019 06:35:59 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 1ae0f8d49043cc8c7bc4a31966ea078747edd490
Author: Andy Wingo <address@hidden>
Date: Tue Oct 29 10:34:35 2019 +0100
Add record-type-parent definition.
* module/ice-9/boot-9.scm (record-type-parent): New definition.
---
module/ice-9/boot-9.scm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index d310a13..db21c69 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -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)
- [Guile-commits] branch master updated (04615d3 -> 73d0a3b), Andy Wingo, 2019/10/29
- [Guile-commits] 05/06: Add record-type-parent definition.,
Andy Wingo <=
- [Guile-commits] 03/06: Rename final? record type flag; add support for opaque?, Andy Wingo, 2019/10/29
- [Guile-commits] 02/06: Guile `make-record-type' supports non-generative definition, Andy Wingo, 2019/10/29
- [Guile-commits] 01/06: Change record type "flags" field to "properties", Andy Wingo, 2019/10/29
- [Guile-commits] 06/06: Rebase R6RS records on top of core records, Andy Wingo, 2019/10/29
- [Guile-commits] 04/06: Add support for immutable fields in core records, Andy Wingo, 2019/10/29