* Toplevel with camlp4
@ 2009-03-27 1:59 Andre Nathan
2009-03-27 2:15 ` [Caml-list] " Peng Zang
0 siblings, 1 reply; 3+ messages in thread
From: Andre Nathan @ 2009-03-27 1:59 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Toplevel with camlp4
2009-03-27 1:59 Toplevel with camlp4 Andre Nathan
@ 2009-03-27 2:15 ` Peng Zang
2009-03-27 3:02 ` Andre Nathan
0 siblings, 1 reply; 3+ messages in thread
From: Peng Zang @ 2009-03-27 2:15 UTC (permalink / raw)
To: caml-list; +Cc: Andre Nathan, caml-list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Are you using OCaml 3.10? I recall there's a bug that doesn't let you #use
more than once due to bad file descriptors. It's been fixed in 3.11
Peng
On Thursday 26 March 2009 09:59:20 pm Andre Nathan wrote:
> 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
>
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
iD8DBQFJzDbHfIRcEFL/JewRAnTkAKC6pIKCeHpMqBjPXh1p04uvr0Gn/ACgjndL
jYngI1gXMosxmcuDMmjAo3M=
=ghYE
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-27 2:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27 1:59 Toplevel with camlp4 Andre Nathan
2009-03-27 2:15 ` [Caml-list] " Peng Zang
2009-03-27 3:02 ` Andre Nathan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox