From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Fix SRFI-9 for records without fields Date: Sat, 19 Jun 2010 14:23:53 +0200 Message-ID: <87aaqrus6e.fsf@delenn.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1276950266 23405 80.91.229.12 (19 Jun 2010 12:24:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Jun 2010 12:24:26 +0000 (UTC) To: Guile Development Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jun 19 14:24:24 2010 connect(): No such file or directory Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OPx5z-00020K-4u for guile-devel@m.gmane.org; Sat, 19 Jun 2010 14:24:23 +0200 Original-Received: from localhost ([127.0.0.1]:36742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPx5y-00008W-Ji for guile-devel@m.gmane.org; Sat, 19 Jun 2010 08:24:22 -0400 Original-Received: from [140.186.70.92] (port=60088 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPx5c-0008Rb-QU for guile-devel@gnu.org; Sat, 19 Jun 2010 08:24:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPx5b-0003Px-OY for guile-devel@gnu.org; Sat, 19 Jun 2010 08:24:00 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:40319) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OPx5b-0003Pc-Bd for guile-devel@gnu.org; Sat, 19 Jun 2010 08:23:59 -0400 Original-Received: (qmail invoked by alias); 19 Jun 2010 12:23:57 -0000 Original-Received: from 83-215-154-5.hage.dyn.salzburg-online.at (EHLO nathot.lan) [83.215.154.5] by mail.gmx.net (mp025) with SMTP; 19 Jun 2010 14:23:57 +0200 X-Authenticated: #3102804 X-Provags-ID: V01U2FsdGVkX1+E+/09IL6EVzVIErycY9jbtn/hg/5DHBs4OKAa9Z 1yVAK36r1iGpjp Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by nathot.lan (Postfix) with ESMTP id 366AB3A62F for ; Sat, 19 Jun 2010 14:23:57 +0200 (CEST) Original-Received: from nathot.lan ([127.0.0.1]) by localhost (nathot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xlf4T3xO5iYv for ; Sat, 19 Jun 2010 14:23:53 +0200 (CEST) Original-Received: from delenn.lan (delenn.lan [192.168.3.11]) by nathot.lan (Postfix) with ESMTP id 66F223A62E for ; Sat, 19 Jun 2010 14:23:53 +0200 (CEST) Original-Received: by delenn.lan (Postfix, from userid 1000) id 41C1A74DC4; Sat, 19 Jun 2010 14:23:53 +0200 (CEST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10516 Archived-At: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=srfi-9-fix.diff 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) --=-=-= -- Andreas Rottmann -- --=-=-=--