From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA19080; Thu, 25 Apr 2002 20:17:20 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA18904 for ; Thu, 25 Apr 2002 20:17:17 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g3PIHFT23615 for ; Thu, 25 Apr 2002 20:17:16 +0200 (MET DST) Received: (qmail 8358 invoked from network); 25 Apr 2002 18:17:13 -0000 Received: from adsl-host-sf-228.apexworld.net (HELO checkerlap.d6.com) (66.114.212.228) by relay1.pair.com with SMTP; 25 Apr 2002 18:17:13 -0000 X-pair-Authenticated: 66.114.212.228 Message-Id: <4.3.2.7.2.20020425104214.02e42a90@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 25 Apr 2002 10:54:31 -0700 To: Tomasz Zielonka From: Chris Hecker Subject: Re: pervasives (was: Re: [Caml-list] How to read three integers from a text-file... ?) Cc: caml-list@inria.fr In-Reply-To: <20020425063351.GA32124@cs.net.pl> References: <4.3.2.7.2.20020424222749.02d10a90@mail.d6.com> <15557.14957.358556.545541@absurd.mimuw.edu.pl> <15557.14957.358556.545541@absurd.mimuw.edu.pl> <4.3.2.7.2.20020424222749.02d10a90@mail.d6.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >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... Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners