Read References field; referred by listing; test & tidy documentation
git-svn-id: file:///srv/svn/repo/kosuzu/trunk@39 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
include Set.Make(String)
|
||||
|
||||
let list_of_csv x = Str.(split (regexp " *, *")) (String.trim x)
|
||||
let of_string x = of_list (list_of_csv x)
|
||||
let list_of_ssv x = Str.(split (regexp " +")) (String.trim x)
|
||||
|
||||
let of_string ?(separator=list_of_csv) x = of_list (separator x)
|
||||
let of_csv_string x = of_string ~separator:list_of_csv x
|
||||
let of_ssv_string x = of_string ~separator:list_of_ssv x
|
||||
|
||||
let to_string ?(pre="") ?(sep=", ") s =
|
||||
let j a x = match a, x with "", _ -> x | _, "" -> a | _ -> a ^ sep ^ x in
|
||||
fold (fun x acc -> j acc x) s pre
|
||||
|
||||
Reference in New Issue
Block a user