caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andre Nathan <andre@sneakymustard.com>
To: caml-list@inria.fr
Subject: Toplevel with camlp4
Date: Thu, 26 Mar 2009 22:59:20 -0300	[thread overview]
Message-ID: <1238119160.6000.7.camel@homesick> (raw)

Hello

I have the simple program below:

  let () =
    Sys.interactive := false;
    Toploop.initialize_toplevel_env ();
    for i = 1 to (Array.length Sys.argv) - 1 do
      ignore (Toploop.use_file Format.std_formatter Sys.argv.(0))
    done

which works fine when compiled with

  $ ocamlc -o a toplevellib.cma a.ml

and run as

  $ ./a foo.ml bar.ml
  val a : int = 1
  val b : int = 2

Both files are processed correctly. However, if I add camlp4 to the
compilation options, as in

  $ ocamlc -o a toplevellib.cma -I +camlp4 camlp4o.cma a.ml

the first file is processed, but then I get a bad file descriptor error
for the second one:

  $ ./a foo.ml bar.ml                                      
  val a : int = 1
  I/O error: Bad file descriptor

Does anyone know what could be going on here?

Thanks,
Andre



             reply	other threads:[~2009-03-27  1:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27  1:59 Andre Nathan [this message]
2009-03-27  2:15 ` [Caml-list] " Peng Zang
2009-03-27  3:02   ` Andre Nathan

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=1238119160.6000.7.camel@homesick \
    --to=andre@sneakymustard.com \
    --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;
as well as URLs for NNTP newsgroup(s).