comparison 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
comparison
equal deleted inserted replaced
1056:c42bfbd75ca9 1057:eaba663fd6aa
24 case mindex {Haystack = s, Needle = chs} of 24 case mindex {Haystack = s, Needle = chs} of
25 None => None 25 None => None
26 | Some i => Some (substring s {Start = 0, Len = i}, 26 | Some i => Some (substring s {Start = 0, Len = i},
27 sub s i, 27 sub s i,
28 substring s {Start = i + 1, Len = length s - i - 1}) 28 substring s {Start = i + 1, Len = length s - i - 1})
29
30 fun all f s =
31 let
32 val len = length s
33
34 fun al i =
35 i >= len
36 || (f (sub s i) && al (i + 1))
37 in
38 al 0
39 end