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 MAA14681; Wed, 24 Apr 2002 12:34:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA14735 for caml-list@pauillac.inria.fr; Wed, 24 Apr 2002 12:34:07 +0200 (MET DST) 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 MAA22901 for ; Tue, 23 Apr 2002 12:41:55 +0200 (MET DST) Received: from absurd.mimuw.edu.pl (fw-gw-atm.mimuw.edu.pl [193.0.96.15]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3NAfsv21395 for ; Tue, 23 Apr 2002 12:41:54 +0200 (MET DST) Received: (from chrzaszc@localhost) by absurd.mimuw.edu.pl (8.11.6/8.11.6) id g3NAfn604457; Tue, 23 Apr 2002 12:41:49 +0200 From: Jacek Chrzaszcz MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15557.14957.358556.545541@absurd.mimuw.edu.pl> Date: Tue, 23 Apr 2002 12:41:49 +0200 To: caml-list@inria.fr Subject: [Caml-list] How to read three integers from a text-file... ? X-Mailer: VM 6.92 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello list, Is there a clean way (a one-liner) to read a constant number of integers separated by whitespace from a text-file (or stdin) ? I mean something like scanf("%d%d%d",&a,&b,&c) in C, or readln(a,b,c) in Pascal I know I can use String.index, Str.split or read char by char (this sucks), but you have to admit the Pascal or even C versions are more appealing. I am asking this question, because our students want to use Ocaml for competing in various programming contests, where the comfort and speed (of programming) are essential. Moreover in such contests the use of external libraries (Str) if often forbiden. If the easy way of doing this is missing, may I suggest adding it to the standard library? Jacek Chrzaszcz ------------------- 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