1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-08 19:12:27 +02:00

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.
This commit is contained in:
Julian Graham 2010-06-18 09:49:30 -04:00
parent 5827e220ab
commit 00f79aa4a0
2 changed files with 15 additions and 2 deletions

View file

@ -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