From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Peter Bruhn <bruhn@isis.wu-wien.ac.at>, caml-list@inria.fr
Subject: Re: Newbies question
Date: Mon, 4 Oct 1999 15:37:06 +0200 [thread overview]
Message-ID: <19991004153706.33856@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.LNX.4.05.9910011500140.16555-100000@lux1.wu-wien.ac.at>; from Peter Bruhn on Fri, Oct 01, 1999 at 03:01:28PM +0200
> The following function does not compile, since the compiler thinks it has
> the wrong return type:
You've already received plenty of explanations on what's going on.
Let me just add one easy way to work around this: just have your "try"
construct return () in all cases. Like this:
> let read_res file : ('a * 'b) list =
> let final_result = ref [] in
> let fd = open_in file in
> begin try
> let lexbuf = Lexing.from_channel fd in
> while true do
> let result = Parseres.main Lexres.token lexbuf in
> final_result := result :: !final_result
> done
> with
> Lexres.Eof -> () (* this is the "normal" loop exit *)
> | Parsing.Parse_error ->
> close_in fd; printf "ERROR: Ressourcen Datei fehlerhaft\n";
> exit (-1)
> end;
> close_in fd; !final_result
- Xavier Leroy
prev parent reply other threads:[~1999-10-04 17:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-01 13:01 Peter Bruhn
1999-10-02 18:04 ` Gerd Stolpmann
1999-10-03 10:58 ` Markus Mottl
1999-10-04 13:37 ` Xavier Leroy [this message]
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=19991004153706.33856@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=bruhn@isis.wu-wien.ac.at \
--cc=caml-list@inria.fr \
/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