summaryrefslogtreecommitdiff
path: root/module/rnrs
diff options
context:
space:
mode:
authorJulian Graham <julian.graham@aya.yale.edu>2010-06-18 09:49:30 -0400
committerJulian Graham <julian.graham@aya.yale.edu>2010-06-18 09:49:30 -0400
commit00f79aa4a0953f2f7348aa20f09b34fda257df32 (patch)
treec7ed50479d8cc10f1dd020ec1ee0331967c2622e /module/rnrs
parent5827e220abac373645e637ece99a9c6550c96bf0 (diff)
downloadguile-00f79aa4a0953f2f7348aa20f09b34fda257df32.tar.gz
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.
Diffstat (limited to 'module/rnrs')
-rw-r--r--module/rnrs/conditions.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/module/rnrs/conditions.scm b/module/rnrs/conditions.scm
index 9c6539fef..53d4d0f6c 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