From: Nicolas C. <war...@fr...> - 2005-05-28 07:10:51
|
> Hi, > > I see you have a printf function in IO that works on the output type, > but for symmetry, why is there no scanf for the input type? > > Jonathan At first, it was not asked before, so that's the reason it's not in IO. A reason I can see now not to add it is that will link the whole Scanf module ( 32 Ko ) just for this function as soon as you use IO. You can simply use the following : let io_scanf ch = Scanf.bscanf (Scanf.Scanbuf.from_function (fun() -> IO.read ch)) Nicolas |