unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Fix SRFI-9 for records without fields
@ 2010-06-19 12:23 Andreas Rottmann
  0 siblings, 0 replies; only message in thread
From: Andreas Rottmann @ 2010-06-19 12:23 UTC (permalink / raw)
  To: Guile Development

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: srfi-9-fix.diff --]
[-- Type: text/x-diff, Size: 1398 bytes --]

From: Andreas Rottmann <a.rottmann@gmx.at>
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)

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]


-- 
Andreas Rottmann -- <http://rotty.yi.org/>

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-19 12:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-19 12:23 [PATCH] Fix SRFI-9 for records without fields Andreas Rottmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).