From: Amit D. <ad...@Co...> - 2003-02-28 17:20:26
|
I was about to reply about extentions to "Global", then I realized that it was not quite was I thought it was... I had been expecting a new pervasives, ooops :) The name ExtPervasives is misleading, because there functions are not "pervasive" in the truest sense, however the name does fit with the pattern Ext+OCaml core library name. I didn't document the obvious functions. module type ExtPervasives = sig (* SML-like names; other have suggested alternates: handling 'a options w/o match cases *) val val_of : 'a option -> 'a val is_some : 'a option -> bool val string_of_bool : bool -> string val print_bool : bool -> unit val prerr_bool : bool -> unit val output_int : out_channel -> int -> unit val output_float : out_channel -> float -> unit ...etc for basic types... end Also, although I don't have this, what do people think about: val input_int : in_channel -> int val input_float : in_channel -> float val input_string : in_channel -> string Which would have similar semantics to the C++ ">>" operators: whitespace delimits tokens, but is otherwise ignored, and line breaks are just another whitespace delimiter. -Amit |