From: Andreas Rottmann Subject: Fix SRFI-9 for records without fields * module/srfi/srfi-9.scm (define-record-type): Deal with fieldless records. * test-suite/tests/srfi-9.test: Add a fieldless record definition. --- module/srfi/srfi-9.scm | 4 ++++ test-suite/tests/srfi-9.test | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/module/srfi/srfi-9.scm b/module/srfi/srfi-9.scm index 39f4e34..80c3b60 100644 --- a/module/srfi/srfi-9.scm +++ b/module/srfi/srfi-9.scm @@ -95,6 +95,8 @@ (lambda (x) (define (field-identifiers field-specs) (syntax-case field-specs () + (() + '()) ((field-spec) (syntax-case #'field-spec () ((name accessor) #'(name)) @@ -138,6 +140,8 @@ (define (accessors type-name field-specs indices) (syntax-case field-specs () + (() + #'()) ((field-spec) (syntax-case #'field-spec () ((name accessor) diff --git a/test-suite/tests/srfi-9.test b/test-suite/tests/srfi-9.test index a645ddc..cf933a8 100644 --- a/test-suite/tests/srfi-9.test +++ b/test-suite/tests/srfi-9.test @@ -23,6 +23,8 @@ #:use-module (srfi srfi-9)) +(define-record-type :qux (make-qux) qux?) + (define-record-type :foo (make-foo x) foo? (x get-x) (y get-y set-y!)) -- tg: (c399333..) t/srfi-9-fix (depends on: master)