let to_character_list s = let res = ref [] in for i = S.length s - 1 downto 0 do res := S.get s i :: !res done; !res