diff lib/ur/string.ur @ 1057:eaba663fd6aa

Represent FFI function names as strings, to deal with cross-file recursion
author Adam Chlipala <adamc@hcoop.net>
date Sat, 05 Dec 2009 14:01:34 -0500
parents e46227efcbba
children 85d194409b17
line wrap: on
line diff
--- a/lib/ur/string.ur	Thu Dec 03 14:32:47 2009 -0500
+++ b/lib/ur/string.ur	Sat Dec 05 14:01:34 2009 -0500
@@ -26,3 +26,14 @@
       | Some i => Some (substring s {Start = 0, Len = i},
                         sub s i,
                         substring s {Start = i + 1, Len = length s - i - 1})
+
+fun all f s =
+    let
+        val len = length s
+
+        fun al i =
+            i >= len
+            || (f (sub s i) && al (i + 1))
+    in
+        al 0
+    end