diff options
author | Andreas Rottmann <a.rottmann@gmx.at> | 2010-08-28 10:16:30 -0700 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-08-28 10:16:30 -0700 |
commit | 23988e8c50e62355689f5bcb34ca65c45fb35fc7 (patch) | |
tree | c60dd81bd9006b0fc947c00367036ae758d9e513 /module/rnrs/conditions.scm | |
parent | 7d0e17389c6856883a87f914d0d7c916620832d5 (diff) | |
download | guile-23988e8c50e62355689f5bcb34ca65c45fb35fc7.tar.gz |
Several fixes to R6RS libraries
* module/rnrs/arithmetic/fixnums.scm (fixnum-width): Make this return an
an exact integer instead of an inexact number.
* module/rnrs/base.scm (assertion-violation): Implement.
* module/rnrs/conditions.scm (simple-conditions): Allow also simple
conditions as argument.
* module/rnrs/enums.scm (define-enumeration): Properly construct empty
enumeration sets.
* module/rnrs/exceptions.scm (guard): Don't restrict the body to a
single expression.
* module/rnrs/records/syntactic.scm (define-record-type0): Expand into a
series of definitions only.
Diffstat (limited to 'module/rnrs/conditions.scm')
-rw-r--r-- | module/rnrs/conditions.scm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/module/rnrs/conditions.scm b/module/rnrs/conditions.scm index 53d4d0f6c..b89722184 100644 --- a/module/rnrs/conditions.scm +++ b/module/rnrs/conditions.scm @@ -95,7 +95,17 @@ (define make-compound-condition (record-constructor (make-record-constructor-descriptor &compound-condition #f #f))) - (define simple-conditions (record-accessor &compound-condition 0)) + (define simple-conditions + (let ((compound-ref (record-accessor &compound-condition 0))) + (lambda (condition) + (cond ((compound-condition? condition) + (compound-ref condition)) + ((condition-internal? condition) + (list condition)) + (else + (assertion-violation 'simple-conditions + "not a condition" + condition)))))) (define (condition? obj) (or (compound-condition? obj) (condition-internal? obj))) |