caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "MONATE Benjamin 205998" <Benjamin.MONATE@cea.fr>
To: "Joel Christner" <joel.christner@gmail.com>,
	"caml-list" <caml-list@yquem.inria.fr>
Subject: RE : [Caml-list] Re: Toplevel function question
Date: Thu, 14 May 2009 07:25:12 +0200	[thread overview]
Message-ID: <5EFD4D7AC6265F4D9D3A849CEA92191901576830@LAXA.intra.cea.fr> (raw)
In-Reply-To: <9da743ed0905131710w5563de39i60f1d60c071ff515@mail.gmail.com>

Hi,

The last "let" is missing its corresponding "in".
 let _ =
  let lexbuf = Lexing.from_channel stdin in
  let rec storeoriginalprogram =
    let expr = lexbuf in
    match expr with
    | EOF   -> ()
    | _     -> (add_text originalprogramcontents expr); storeoriginalprogram
  in let parseprogram = List.iter
    (fun n -> print_string n; print_string "\n";) originalprogramcontents
  in parsepreogram

You may also remove the last "let": 

let _ =
  let lexbuf = Lexing.from_channel stdin in
  let rec storeoriginalprogram =
    let expr = lexbuf in
    match expr with
    | EOF   -> ()
    | _     -> (add_text originalprogramcontents expr); storeoriginalprogram
  in 
  List.iter
    (fun n -> print_string n; print_string "\n";) originalprogramcontents

Hope this helps.
--
Benjamin Monate
CEA LIST
Head of Software Safety Lab.


  reply	other threads:[~2009-05-14  5:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 23:43 Joel Christner
2009-05-14  0:10 ` Joel Christner
2009-05-14  5:25   ` MONATE Benjamin 205998 [this message]
2009-05-14  7:52   ` [Caml-list] " Gregory BELLIER
2009-05-14 10:23   ` Cedric Auger
2009-05-14 10:29     ` Cedric Auger

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=5EFD4D7AC6265F4D9D3A849CEA92191901576830@LAXA.intra.cea.fr \
    --to=benjamin.monate@cea.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=joel.christner@gmail.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).