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 BAA03851; Wed, 21 Jul 2004 01:36: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 BAA03725 for ; Wed, 21 Jul 2004 01:36:54 +0200 (MET DST) Received: from hotmail.com (bay22-f36.bay22.hotmail.com [64.4.16.86]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6KNaqEV001624 for ; Wed, 21 Jul 2004 01:36:53 +0200 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 20 Jul 2004 16:36:51 -0700 Received: from 213.107.3.38 by by22fd.bay22.hotmail.msn.com with HTTP; Tue, 20 Jul 2004 23:36:51 GMT X-Originating-IP: [213.107.3.38] X-Originating-Email: [nickwu2000@hotmail.com] X-Sender: nickwu2000@hotmail.com From: "Nicolas Wu" To: caml-list@inria.fr Subject: [Caml-list] input_line ... have i gone mad? Date: Tue, 20 Jul 2004 23:36:51 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 20 Jul 2004 23:36:51.0973 (UTC) FILETIME=[6F0F6350:01C46EB2] X-Miltered: at nez-perce with ID 40FDAC94.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; stdin:01 printf:01 printf:01 stdout:01 stdin:01 nicolas:01 flush:01 toplevel:01 exception:02 horribly:04 let:04 let:04 seems:05 i'm:07 www:91 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hey all, i'm trying to write a very simple program using input_line to grab input from stdin ... but it is going horribly wrong! try putting the following in a toplevel: <> open Printf;; let main () = try printf "start"; while true do printf "just before"; flush stdout; let line = input_line stdin in printf "print the line %s" line done with End_of_file -> printf "should exit";; main () ;; <> on my machine, it works fine, but never reaches the "should exit" line- it seems like the End_of_file exception is never thrown - this is the same even if i use read_line () instead of input_line.... what am i doing wrong? thanks! nick _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger ------------------- 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