summaryrefslogtreecommitdiff
path: root/module/srfi
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2019-10-23 12:04:58 +0200
committerAndy Wingo <wingo@pobox.com>2019-10-23 12:04:58 +0200
commitbebc46be14c99709aafe210704508b285973fdfb (patch)
tree030bb8489df521bc5b64438ee0f1f2f740d788c2 /module/srfi
parentf060f1a4e69a21c6a95410f3cea0b7f957c3e2c0 (diff)
downloadguile-bebc46be14c99709aafe210704508b285973fdfb.tar.gz
SRFI-9 uses make-record-type
* module/srfi/srfi-9.scm (%define-record-type): Use make-record-type, instead of rolling our own vtable. Shouldn't have any perf impact.
Diffstat (limited to 'module/srfi')
-rw-r--r--module/srfi/srfi-9.scm19
1 files changed, 7 insertions, 12 deletions
diff --git a/module/srfi/srfi-9.scm b/module/srfi/srfi-9.scm
index 58b588b00..9bb6e6971 100644
--- a/module/srfi/srfi-9.scm
+++ b/module/srfi/srfi-9.scm
@@ -1,7 +1,7 @@
;;; srfi-9.scm --- define-record-type
-;; Copyright (C) 2001, 2002, 2006, 2009, 2010, 2011, 2012,
-;; 2013, 2014, 2018 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2002, 2006, 2008-2014, 2018-2019
+;; Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@@ -315,16 +315,11 @@
#,(constructor #'form #'type-name #'constructor-spec field-ids)
(define type-name
- (let ((rtd (make-struct/no-tail
- record-type-vtable
- '#,(datum->syntax #'here (make-struct-layout layout))
- default-record-printer
- 'type-name
- '#,field-ids
- #f ; Constructor.
- '(final) ; Flags.
- #()))) ; Parents.
- (set-struct-vtable-name! rtd 'type-name)
+ (let ((rtd (make-record-type 'type-name
+ '#,field-ids
+ default-record-printer)))
+ ;; Allow record-type-constructor to return our
+ ;; constructor.
(struct-set! rtd (+ 2 vtable-offset-user) #,ctor-name)
rtd))