summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-10-31 18:16:43 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-10-31 18:17:06 +0100
commit95a08bc1b290117c1c61c49b3c5c945d01120006 (patch)
tree9a1ad4a8e683e3e4d2df134c4f11bf7e196aecc1
parent61140713d03ae58ccf933d00153d7ebaad2be762 (diff)
downloadmew-95a08bc1b290117c1c61c49b3c5c945d01120006.tar.gz
mew-95a08bc1b290117c1c61c49b3c5c945d01120006.tar.xz
mew-95a08bc1b290117c1c61c49b3c5c945d01120006.zip
add sing?
-rw-r--r--mew.scm7
-rw-r--r--mew.svnwiki5
2 files changed, 11 insertions, 1 deletions
diff --git a/mew.scm b/mew.scm
index 7d9d2ac..b4335c8 100644
--- a/mew.scm
+++ b/mew.scm
@@ -14,7 +14,7 @@
      one-of op op*
      per prn puts
      rep
-     set str slurp
+     sing? set str slurp
      tally-accumulator tbl time
      while
      until
@@ -575,4 +575,9 @@
                  (generator-fold f v g)))))
       ((f v) (lambda (o)
                (generator-fold f v (gen o))))))
+
+  (define (sing? l)
+    (match l
+      ((_) #t)
+      (_   #f)))
 )
diff --git a/mew.svnwiki b/mew.svnwiki
index c3c03c7..1f6a963 100644
--- a/mew.svnwiki
+++ b/mew.svnwiki
@@ -151,6 +151,10 @@ applying {{display}} to all {{<args>}}.
 Expands to a lambda expression that is true if its argument is
 {{equal?}} to any of the {{<val>}} passed.
 
+<procedure>(sing? <list>)</procedure>
+
+Return true iff {{<list>}} is a proper list of length 1.
+
 
 == I/O helpers
 
@@ -300,6 +304,7 @@ by {{gen}}) and folds the function {{<f>}} over its values.  If given,
 folding starts with {{<init>}}, else with the first element yielded by
 the generator.  If the generator is empty, return {{(<f>)}}.
 
+
 == Regular expressions
 
 <procedure>(?~ <str> <irx>)</procedure>