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