summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-10-31 23:13:18 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-10-31 23:13:18 +0100
commit86bb105de83830145be0f9b715499ef950f5c018 (patch)
tree9408bd41b52ccce78b81940feb7e4d12248dad05
parent2cd88724b88fb7d97ff3806953f262b68008474d (diff)
downloadmew-86bb105de83830145be0f9b715499ef950f5c018.tar.gz
mew-86bb105de83830145be0f9b715499ef950f5c018.tar.xz
mew-86bb105de83830145be0f9b715499ef950f5c018.zip
add act
-rw-r--r--mew.scm5
-rw-r--r--mew.svnwiki4
2 files changed, 8 insertions, 1 deletions
diff --git a/mew.scm b/mew.scm
index 1615d7b..1af0701 100644
--- a/mew.scm
+++ b/mew.scm
@@ -1,6 +1,6 @@
 (module mew
   (export
-     accumulate at
+     act accumulate at
      comp
      dec def div
      empty? eof esc
@@ -654,4 +654,7 @@
   (define (juxt . fs)
     (lambda args
       (unlist (map (lambda (f) (apply f args)) fs))))
+
+  (define (act x . fs)
+    ((apply per fs) x))
 )
diff --git a/mew.svnwiki b/mew.svnwiki
index a1c96fc..a838550 100644
--- a/mew.svnwiki
+++ b/mew.svnwiki
@@ -142,6 +142,10 @@ Alias for {{compose}}.
 
 Reverse function composition.
 
+<procedure>(act <obj> <fun>...)</procedure>
+
+Reverse function compose all {{<fun>}}, then apply to {{<obj>}}.
+
 <procedure>(juxt <fun>...)</procedure>
 
 Returns a function that applies each {{<fun>}} to its arguments and