[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-11-102-g0
From: |
Julian Graham |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-11-102-g00f79aa |
Date: |
Fri, 18 Jun 2010 14:02:18 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=00f79aa4a0953f2f7348aa20f09b34fda257df32
The branch, master has been updated
via 00f79aa4a0953f2f7348aa20f09b34fda257df32 (commit)
from 5827e220abac373645e637ece99a9c6550c96bf0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 00f79aa4a0953f2f7348aa20f09b34fda257df32
Author: Julian Graham <address@hidden>
Date: Fri Jun 18 09:49:30 2010 -0400
Fix `define-condition-type' to use condition-accessors, not record
accessors.
* module/rnrs/conditions.scm (define-condition-type): The generated
accessors should be condition accessors, which know how to unpack a
compound condition; these can then delegate to the appropriate record
accessors.
* test-suite/tests/r6rs-conditions.test: New test case to verify above.
-----------------------------------------------------------------------
Summary of changes:
module/rnrs/conditions.scm | 9 +++++++--
test-suite/tests/r6rs-conditions.test | 8 ++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/module/rnrs/conditions.scm b/module/rnrs/conditions.scm
index 9c6539f..53d4d0f 100644
--- a/module/rnrs/conditions.scm
+++ b/module/rnrs/conditions.scm
@@ -126,10 +126,15 @@
(generate-accessors
(syntax-rules ()
((_ counter (f a) . rest)
- (begin (define a (record-accessor condition-type counter))
+ (begin (define a
+ (condition-accessor
+ condition-type
+ (record-accessor condition-type counter)))
(generate-accessors (+ counter 1) rest)))
((_ counter ((f a)))
- (define a (record-accessor condition-type counter)))
+ (define a
+ (condition-accessor
+ condition-type (record-accessor condition-type counter))))
((_ counter ()) (begin))
((_ counter) (begin)))))
(begin
diff --git a/test-suite/tests/r6rs-conditions.test
b/test-suite/tests/r6rs-conditions.test
index 5883131..9432f37 100644
--- a/test-suite/tests/r6rs-conditions.test
+++ b/test-suite/tests/r6rs-conditions.test
@@ -21,6 +21,9 @@
:use-module ((rnrs conditions) :version (6))
:use-module (test-suite lib))
+(define-condition-type &a &condition make-a-condition a-condition? (foo a-foo))
+(define-condition-type &b &condition make-b-condition b-condition? (bar b-bar))
+
(with-test-prefix "condition?"
(pass-if "condition? is #t for simple conditions"
(condition? (make-error)))
@@ -89,3 +92,8 @@
(vc (make-violation))
(c (condition vc mc)))
(equal? (ma c) "foo"))))
+
+(with-test-prefix "define-condition-type"
+ (pass-if "define-condition-type produces proper accessors"
+ (let ((c (condition (make-a-condition 'foo) (make-b-condition 'bar))))
+ (and (eq? (a-foo c) 'foo) (eq? (b-bar c) 'bar)))))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-11-102-g00f79aa,
Julian Graham <=