summary refs log tree commit diff
path: root/mew.scm
diff options
context:
space:
mode:
Diffstat (limited to 'mew.scm')
-rw-r--r--mew.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/mew.scm b/mew.scm
index 16b3479..f70fbee 100644
--- a/mew.scm
+++ b/mew.scm
@@ -1,6 +1,6 @@
 (module mew
   (export
-     act accumulate at
+     act accumulate andloc at
      comp
      dec def del-at div
      empty? eof esc
@@ -165,6 +165,15 @@
       ((_ (x y . brest) . rest)
        (match-let ((x y)) (loc brest . rest)))))
 
+  (define-syntax andloc
+    (syntax-rules (_)
+      ((_ () . rest)
+       (let () . rest))
+      ((_ (_ y . brest) . rest)
+       (let ((unused y)) (and unused (andloc brest . rest))))
+      ((_ (x y . brest) . rest)
+       (let ((x y)) (and x (andloc brest . rest))))))
+
   (define-syntax fun*
     (syntax-rules ()
       ((_ args body rest ...)