diff options
author | Andy Wingo <wingo@pobox.com> | 2019-11-03 21:36:39 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2019-11-03 21:36:39 +0100 |
commit | 90d52a9e1dd6419e0fef13e7b09e284e9d895920 (patch) | |
tree | ff43795e17828ce734d118e308d6d1d296ba1721 /module/srfi | |
parent | 9f1a6717349ce3a6c1617dd7d606bc02386f1183 (diff) | |
download | guile-90d52a9e1dd6419e0fef13e7b09e284e9d895920.tar.gz |
Add `record-type-has-parent?'.
* module/ice-9/boot-9.scm (record-type-has-parent?): New function.
* module/srfi/srfi-35.scm (condition-type?): Use it.
Diffstat (limited to 'module/srfi')
-rw-r--r-- | module/srfi/srfi-35.scm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/module/srfi/srfi-35.scm b/module/srfi/srfi-35.scm index e4246bb7d..73e9394ef 100644 --- a/module/srfi/srfi-35.scm +++ b/module/srfi/srfi-35.scm @@ -77,12 +77,8 @@ supertypes." (define (condition-type? obj) "Return true if OBJ is a condition type." - ;; FIXME: Use record-type-is-a? or something like that. - (or (eq? obj &condition) - (and (record-type? obj) - (let ((parents (record-type-parents obj))) - (and (< 0 (vector-length parents)) - (eq? (vector-ref parents 0) &condition)))))) + (and (record-type? obj) + (record-type-has-parent? obj &condition))) (define simple-condition? (record-predicate &condition)) |