From: Nicolas C. <war...@fr...> - 2003-05-16 13:20:02
|
I added the new primitive : Enum.from : ('a -> unit) -> 'a t which is similar to Stream.from. ( The only difference is that the "count" function is calling "Enum.force", which is creating a list of the values and then modifying the enum to enumerate on the list with a count reference ) typical usages are for I/O where you can't provide a count function at creation time : let input_char_enum ch = Enum.from (fun () -> try input_char ch with End_of_file -> raise Enum.No_more_elements) (added to Std , with and implementation of input_all ) Nicolas Cannasse |