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 CAA04449; Wed, 21 Jul 2004 02:02:02 +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 CAA03334 for ; Wed, 21 Jul 2004 02:02:00 +0200 (MET DST) Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp [192.51.44.35]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6L01wEV004203 for ; Wed, 21 Jul 2004 02:01:59 +0200 Received: from m7.gw.fujitsu.co.jp ([10.0.50.77]) by fgwmail5.fujitsu.co.jp (8.12.10/Fujitsu Gateway) id i6KNwkaw024763; Wed, 21 Jul 2004 08:58:46 +0900 (envelope-from francois@ist.fujitsu.com) Received: from s1.gw.fujitsu.co.jp by m7.gw.fujitsu.co.jp (8.12.10/Fujitsu Domain Master) id i6KNwklb026007; Wed, 21 Jul 2004 08:58:46 +0900 (envelope-from francois@ist.fujitsu.com) Received: from sesvr1.ist.fujitsu.com (sesvr1.ist.fujitsu.com [10.123.116.111]) by s1.gw.fujitsu.co.jp (8.12.10) id i6KNwja0025309; Wed, 21 Jul 2004 08:58:45 +0900 (envelope-from francois@ist.fujitsu.com) Received: from vonNeumann.sz.ist.fujitsu.com by sesvr1.ist.fujitsu.com (8.13.0/8.13.0/EGV-Lab.20040621) with ESMTP id i6KNwjYe004040; Wed, 21 Jul 2004 08:58:45 +0900 (JST) From: Francois Burgisser To: "Nicolas Wu" , caml-list@inria.fr Subject: Re: [Caml-list] input_line ... have i gone mad? Date: Wed, 21 Jul 2004 09:01:02 +0900 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200407210901.03068.francois@ist.fujitsu.com> X-Miltered: at nez-perce with ID 40FDB276.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 stdin:01 printf:01 printf:01 stdout:01 stdin:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 bin:01 caml-bugs:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk With the standard input, to get the End_of_file exception thrown, you should close the stream by pressing ctrl+d. Regards, Francois 2004年 7月 21日 水曜日 08:36、Nicolas Wu さんは書きました: > 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 ------------------- 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