From 3fb4b93bc1b68912ee22f8f7445faa087ae500eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 23 Aug 2020 16:25:39 +0200 Subject: Move catch-warnings. --- module/util/exceptions.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'module/util/exceptions.scm') diff --git a/module/util/exceptions.scm b/module/util/exceptions.scm index 8db18605..f316451d 100644 --- a/module/util/exceptions.scm +++ b/module/util/exceptions.scm @@ -83,3 +83,13 @@ (throw 'assertion-error "Assertion for ~a failed, ~a" (quote ,form) ((@@ (util exceptions) prettify-tree) ,(cons 'list form))))) + + +(define-syntax catch-warnings + (syntax-rules () + ((_ default body ...) + (parametrize ((warnings-are-errors #t)) + (catch 'warning + (lambda () + body ...) + (lambda _ default)))))) -- cgit v1.2.3