1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 16:00:22 +02:00

define* in make-record-type

* module/ice-9/boot-9.scm (make-record-type): Use define*.
This commit is contained in:
Andy Wingo 2010-05-21 23:34:54 +02:00
parent a4c8a02e09
commit b2669c41a7

View file

@ -640,7 +640,7 @@ If there is no handler at all, Guile prints an error and then exits."
(define (record-type? obj)
(and (struct? obj) (eq? record-type-vtable (struct-vtable obj))))
(define (make-record-type type-name fields . opt)
(define* (make-record-type type-name fields #:optional printer)
;; Pre-generate constructors for nfields < 20.
(define-syntax make-constructor
(lambda (x)
@ -695,8 +695,7 @@ If there is no handler at all, Guile prints an error and then exits."
(make-struct-layout
(apply string-append
(map (lambda (f) "pw") fields)))
(or (and (pair? opt) (car opt))
default-record-printer)
(or printer default-record-printer)
type-name
(copy-tree fields))))
(struct-set! rtd (+ vtable-offset-user 2)