guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/04: SRFI-9 uses make-record-type


From: Andy Wingo
Subject: [Guile-commits] 01/04: SRFI-9 uses make-record-type
Date: Wed, 23 Oct 2019 08:48:08 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit bebc46be14c99709aafe210704508b285973fdfb
Author: Andy Wingo <address@hidden>
Date:   Wed Oct 23 12:04:58 2019 +0200

    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.
---
 module/srfi/srfi-9.scm | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/module/srfi/srfi-9.scm b/module/srfi/srfi-9.scm
index 58b588b..9bb6e69 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))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]