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 MAA24462; Wed, 21 Jul 2004 12:35:47 +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 MAA20388 for ; Wed, 21 Jul 2004 12:35:46 +0200 (MET DST) Received: from hotmail.com (bay22-f24.bay22.hotmail.com [64.4.16.74]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6LAZiSH017537 for ; Wed, 21 Jul 2004 12:35:45 +0200 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 21 Jul 2004 03:35:43 -0700 Received: from 213.107.3.38 by by22fd.bay22.hotmail.msn.com with HTTP; Wed, 21 Jul 2004 10:35:43 GMT X-Originating-IP: [213.107.3.38] X-Originating-Email: [nickwu2000@hotmail.com] X-Sender: nickwu2000@hotmail.com From: "Nicolas Wu" To: francois@ist.fujitsu.com, caml-list@inria.fr Subject: Re: [Caml-list] input_line ... have i gone mad? Date: Wed, 21 Jul 2004 10:35:43 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 21 Jul 2004 10:35:43.0892 (UTC) FILETIME=[79EB8540:01C46F0E] X-Miltered: at concorde with ID 40FE4700.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 caml-list:01 2004:99 2004:99 8230:99 stdin:01 printf:01 printf:01 stdout:01 stdin:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk ah! :$ how embarassing. i assumed that an empty standard input stream would be achieved by hitting enter, rather than closing it with ctrl-d .. didn't think of that, it does work fine d'oh! thanks again! nick >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 > >With the standard input, to get the End_of_file exception thrown, you >should >close the stream by pressing ctrl+d. > >Regards, > >Francois > >2004”N 7ŒŽ 21“ú �…—j“ú >08:36�ANicolas 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 _________________________________________________________________ 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