From 923e677084733e8b077ab31cb625acf8f6ecdf55 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 26 Mar 2023 18:16:23 +0200 Subject: [PATCH] Make error-object-irritants always returns a list Per R7RS-small, the procedure is defined to return "a list of the irritants encapsulated by error-object", but currently it returns #f if there are no irritants. This has been fixed now. * module/scheme/base.scm (error-object-irritants): Improve R7RS compliance by always returning a list of irritants. --- module/scheme/base.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/scheme/base.scm b/module/scheme/base.scm index c6a73c092..eea2401b2 100644 --- a/module/scheme/base.scm +++ b/module/scheme/base.scm @@ -260,8 +260,9 @@ (exception-message obj))) (define (error-object-irritants obj) - (and (exception-with-irritants? obj) - (exception-irritants obj))) + (if (exception-with-irritants? obj) + (exception-irritants obj) + '())) (define (r7:error message . irritants) (raise-exception -- 2.40.0