/* library for manipulations on strings - by Marc BARILLEY*/ fun toupper (string)= let string -> upperstring in { let 0->i in while i < strlen (upperstring) do let nth_char upperstring i -> c in { if (c >= 97) && (c <= 122) then set_nth_char upperstring i (c-32) else nil; set i = i+1 }; upperstring };; fun wordbuild (wordList)= if wordList==nil then nil else let wordList -> [word next] in if next==nil then word else strcat (strcat word " ") (wordbuild next);; fun phraseBuild (l)= if l==nil then nil else let phraseBuild tl l -> s in strcatn (wordbuild hd l)::"\n"::s::nil;; fun parse10 (s)= let strdup s -> string in { let 0 -> i in while i < strlen string do if (nth_char string i) == 10 then { set string = strcatn (substr string 0 i)::"\\10"::(substr string (i+1) ((strlen string)-i-1))::nil; set i=i+3; } else set i=i+1; string };; fun streq (str1, str2)=!(strcmp str1 str2);;