[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Francois Burgisser <francois@i...> |
| Subject: | Re: [Caml-list] input_line ... have i gone mad? |
With the standard input, to get the End_of_file exception thrown, you should close the stream by pressing ctrl+d. Regards, Francois 2004$BG/(B 7$B7n(B 21$BF|(B $B?eMKF|(B 08:36$B!"(BNicolas Wu $B$5$s$O=q$-$^$7$?(B: > 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: > > <<cut>> > 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 () ;; > <<cut>> > > 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