summary refs log tree commit diff
path: root/mew.scm
diff options
context:
space:
mode:
Diffstat (limited to 'mew.scm')
-rw-r--r--mew.scm18
1 files changed, 16 insertions, 2 deletions
diff --git a/mew.scm b/mew.scm
index 7707851..845a16e 100644
--- a/mew.scm
+++ b/mew.scm
@@ -3,13 +3,13 @@
      act accumulate andloc app at
      boolean
      comp cross-product
-     dec def del-at div dup
+     dec dec! def del-at div dup
      empty? eof esc
      fail fin final for for/into fun*
      gconcatenate gen generator-xfold generic-for-each genumerate get
      gfix giterate gmatch gpick group-by-accumulator gslice-when
      gsplit gsplit-on gwindow
-     imp inc inject inject-accumulator into
+     imp inc inc! inject inject-accumulator into
      juxt
      keys
      len lines loc
@@ -1063,6 +1063,20 @@
       ((_ location . fs)
        (set location (=> location . fs)))))
 
+  (define-syntax inc!
+    (syntax-rules ()
+      ((_ location)
+       (inc! location 1))
+      ((_ location n)
+       (set location (+ location n)))))
+
+  (define-syntax dec!
+    (syntax-rules ()
+      ((_ location)
+       (dec! location 1))
+      ((_ location n)
+       (set location (- location n)))))
+
   (define (and=> x . fs)
     (and x
          (if (null? fs)