caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Wu" <nickwu2000@hotmail.com>
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	[thread overview]
Message-ID: <BAY22-F2445gZfUEJM300017589@hotmail.com> (raw)

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 <francois@ist.fujitsu.com>
>To: "Nicolas Wu" <nickwu2000@hotmail.com>, 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&#8221;N 7&#338;&#381; 21&#8220;ú &#65533;&#8230;&#8212;j&#8220;ú 
>08:36&#65533;ANicolas Wu 
>&#8218;³&#8218;ñ&#8218;Í&#65533;&#8216;&#8218;«&#8218;Ü&#8218;µ&#8218;½:
> > 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

_________________________________________________________________
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


             reply	other threads:[~2004-07-21 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-21 10:35 Nicolas Wu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-07-20 23:36 Nicolas Wu
2004-07-21  0:01 ` Francois Burgisser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY22-F2445gZfUEJM300017589@hotmail.com \
    --to=nickwu2000@hotmail.com \
    --cc=caml-list@inria.fr \
    --cc=francois@ist.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).