aboutsummaryrefslogtreecommitdiff
path: root/module/hnh/util/exceptions.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 03:23:44 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 03:48:22 +0200
commit1976980d4a272fb7fc3694c734bfc6825edfc721 (patch)
tree8460db1176c64895e9968447588953fac85fe7d6 /module/hnh/util/exceptions.scm
parentRemove all inline use-modules. (diff)
downloadcalp-1976980d4a272fb7fc3694c734bfc6825edfc721.tar.gz
calp-1976980d4a272fb7fc3694c734bfc6825edfc721.tar.xz
Centralize (almost) all exports to :export in define-module.
Diffstat (limited to 'module/hnh/util/exceptions.scm')
-rw-r--r--module/hnh/util/exceptions.scm17
1 files changed, 11 insertions, 6 deletions
diff --git a/module/hnh/util/exceptions.scm b/module/hnh/util/exceptions.scm
index eed310bb..36b018d1 100644
--- a/module/hnh/util/exceptions.scm
+++ b/module/hnh/util/exceptions.scm
@@ -6,33 +6,38 @@
#:use-module ((system vm frame)
:select (frame-bindings binding-ref))
- )
+ :export (warning-handler
+ warnings-are-errors
+ warning
+ fatal
+ filter-stack
+ ))
-(define-public warning-handler
+(define warning-handler
(make-parameter
(lambda (fmt . args)
(format #f "WARNING: ~?~%" fmt args))))
-(define-public warnings-are-errors
+(define warnings-are-errors
(make-parameter #f))
;; forwards return from warning-hander. By default returns an unspecified value,
;; but instances are free to provide a proper return value and use it.
-(define-public (warning fmt . args)
+(define (warning fmt . args)
(display (apply (warning-handler) fmt (or args '()))
(current-error-port))
(when (warnings-are-errors)
(throw 'warning fmt args)))
-(define-public (fatal fmt . args)
+(define (fatal fmt . args)
(display (format #f "FATAL: ~?~%" fmt (or args '()))
(current-error-port))
(raise 2)
)
-(define-public (filter-stack pred? stk)
+(define (filter-stack pred? stk)
(concatenate
(for i in (iota (stack-length stk))
(filter pred? (map binding-ref (frame-bindings (stack-ref stk i)))))))