From: Peter J. <pe...@jo...> - 2004-04-09 16:11:23
|
> I don't like so much the idea of having nread returning a pair. Fine, I can see why you might want a simpler interface in a general-purpose library. I really did it that way because it was slightly more convenient with the code I'm using myself, but I guess that's not a very good design principle... ^^; > I have been looking a little and it looks ok to modify the behavior > of IO without actually modifying the interface. We just have to > replace really_input by input - followed by a String resize if the > readed number of chars is lower than the requested one. The only reason I didn't use Pervasives.input is that it doesn't promise to return the number of items you requested, even if that many are available - for all the other inputs, that does seem to be guaranteed. I'm not sure if it really matters or not. > Please tell me if it's ok for you this way, I'll then make the > changes. Yes, the version you describe would work just as well for me. |