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 IAA05057; Thu, 25 Apr 2002 08:33:55 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA04984 for ; Thu, 25 Apr 2002 08:33:55 +0200 (MET DST) Received: from mail.cs.net.pl (cyber.cs.net.pl [62.233.142.98]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g3P6Xsr01938 for ; Thu, 25 Apr 2002 08:33:54 +0200 (MET DST) Received: by mail.cs.net.pl (Postfix, from userid 510) id D14AADFD; Thu, 25 Apr 2002 08:33:51 +0200 (CEST) Date: Thu, 25 Apr 2002 08:33:51 +0200 From: Tomasz Zielonka To: Chris Hecker Cc: caml-list@inria.fr Subject: Re: pervasives (was: Re: [Caml-list] How to read three integers from a text-file... ?) Message-ID: <20020425063351.GA32124@cs.net.pl> References: <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 Content-Disposition: inline In-Reply-To: <4.3.2.7.2.20020424222749.02d10a90@mail.d6.com> User-Agent: Mutt/1.3.28i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Apr 24, 2002 at 10:30:48PM -0700, Chris Hecker wrote: > > I was about to answer, "why not just use read_int in a loop from the > in_channel?", but then I looked and it's only defined on stdin (as is > read_float). val read_int : unit -> int (** Flush standard output, then read one line from standard input and convert it to an integer. Raise [Failure "int_of_string"] if the line read is not a valid representation of an integer. *) This function assumes that every integer is on a separate line. This is rarely true in programming contests. > Chris tom -- Tomek Zielonka ------------------- 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