summary refs log tree commit diff
path: root/mew.scm
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-07 23:36:43 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-07 23:36:43 +0100
commit7c7c335386134bc1e45cf62fc2755173facc40cc (patch)
treeba70384701e9c63bbbe7ada638eb7a2b1f056e94 /mew.scm
parentf7c45171f5ef9a82612e8166184559b8ab781c4f (diff)
downloadmew-7c7c335386134bc1e45cf62fc2755173facc40cc.tar.gz
mew-7c7c335386134bc1e45cf62fc2755173facc40cc.tar.xz
mew-7c7c335386134bc1e45cf62fc2755173facc40cc.zip
add fail
Diffstat (limited to 'mew.scm')
-rw-r--r--mew.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/mew.scm b/mew.scm
index 4e060a4..6ae2e6d 100644
--- a/mew.scm
+++ b/mew.scm
@@ -5,7 +5,7 @@
      comp
      dec def del-at div
      empty? eof esc
-     fin final for fun*
+     fail fin final for fun*
      gconcatenate gen generic-for-each genumerate get gfix giterate gmatch
      gpick group-by-accumulator gslice-when gsplit gwindow
      inc inject into
@@ -38,6 +38,7 @@
              (print puts)
              (complement negate)
              (compose comp))
+          (chicken condition)
           (chicken module)
           (chicken port)
           (chicken repl)
@@ -788,6 +789,13 @@
       ((_ 3) (lambda (a b c d . args) d))
       ((_ n) (lambda args (list-ref args n)))))
 
+  (define (fail exn . args)
+    (if (list? exn)
+      (signal (apply condition
+                     (list (car exn) 'message (apply format args))
+                     (map list (cdr exn))))
+      (apply fail '(exn) exn args)))
+
   (let ((old-repl-prompt (repl-prompt)))
     (repl-prompt (lambda ()
                    (let ((old-prompt (old-repl-prompt)))