diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-09-06 01:46:23 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-09-06 01:46:23 +0200 |
commit | cdd59dee8834331aded27913e0ce2e85461c4d93 (patch) | |
tree | 51207efc9279ce363c443bfd66fac59bc972ca97 /module/c | |
parent | Improve datetime error messages. (diff) | |
download | calp-cdd59dee8834331aded27913e0ce2e85461c4d93.tar.gz calp-cdd59dee8834331aded27913e0ce2e85461c4d93.tar.xz |
Add filter-stack.
Diffstat (limited to '')
-rw-r--r-- | module/calp/util/exceptions.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/module/calp/util/exceptions.scm b/module/calp/util/exceptions.scm index 29e1472c..53d9475d 100644 --- a/module/calp/util/exceptions.scm +++ b/module/calp/util/exceptions.scm @@ -3,6 +3,10 @@ #:use-module (calp util) #:use-module (calp util config) #:use-module (ice-9 format) + + #:use-module ((system vm frame) + :select (frame-bindings binding-ref)) + #:export (throw-returnable catch-multiple assert)) @@ -93,3 +97,9 @@ (lambda () body ...) (lambda _ default)))))) + + +(define-public (filter-stack pred? stk) + (concatenate + (for i in (iota (stack-length stk)) + (filter pred? (map binding-ref (frame-bindings (stack-ref stk i))))))) |