mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 14:21:10 +02:00
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.
This commit is contained in:
parent
b1e5445f77
commit
c4a8200fa0
2 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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!))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue