From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 727D1BBAF for ; Fri, 27 Mar 2009 02:54:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtwDAA/Py0nIuX5CgWdsb2JhbACWAQEBFiK6SoN3Bg X-IronPort-AV: E=Sophos;i="4.38,429,1233529200"; d="scan'208";a="25068780" Received: from mta19.f3.k8.com.br ([200.185.126.66]) by mail3-smtp-sop.national.inria.fr with ESMTP; 27 Mar 2009 02:54:55 +0100 Received: from localhost (localhost [127.0.0.1]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id BC8162800093 for ; Fri, 27 Mar 2009 01:54:52 +0000 (GMT) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpa.f3.k8.com.br ([127.0.0.1]) by localhost (mta19.f3.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8g62nPibXXLt for ; Fri, 27 Mar 2009 01:54:52 +0000 (GMT) Received: from [189.106.1.98] (unknown [189.106.1.98]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id 2EB842800091 for ; Fri, 27 Mar 2009 01:54:51 +0000 (GMT) Subject: Toplevel with camlp4 From: Andre Nathan To: caml-list@inria.fr Content-Type: text/plain Date: Thu, 26 Mar 2009 22:59:20 -0300 Message-Id: <1238119160.6000.7.camel@homesick> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; toplevel:01 camlp:01 toploop:01 toplevel:01 argv:01 toploop:01 argv:01 ocamlc:01 toplevellib:01 foo:01 val:01 val:01 camlp:01 compilation:01 ocamlc:01 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