Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] How to read three integers from a text-file... ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-25 (18:17)
From: Chris Hecker <checker@d...>
Subject: Re: pervasives (was: Re: [Caml-list] How to read three integers from a text-file... ?)

>This function assumes that every integer is on a separate line. This is
>rarely true in programming contests.

Ah, I missed the "read one line" part.  Interesting that print_int doesn't 
insert a newline but read_int eats one...another assymetry.  int_of_string 
also seems to require that the string be only the integer, so int_of_string 
"123 some more" excepts.

It seems like it might be useful to have the core simple types (string, 
int, float) have orthogonal reading and writing functions in 
Pervasives.  Maybe it's not worth the effort, though...


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: