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=2.9 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 9C341BBAF for ; Fri, 27 Mar 2009 03:15:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQBADfUy0nRVdmdimdsb2JhbACNFIguPwEBAQoJDAcPBaoHB4EAjz8BAwEDg3QGhS4 X-IronPort-AV: E=Sophos;i="4.38,429,1233529200"; d="scan'208";a="23357461" Received: from mail-gx0-f157.google.com ([209.85.217.157]) by mail2-smtp-roc.national.inria.fr with ESMTP; 27 Mar 2009 03:15:38 +0100 Received: by gxk1 with SMTP id 1so2598457gxk.9 for ; Thu, 26 Mar 2009 19:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:content-type :content-transfer-encoding:content-disposition:message-id; bh=t1i9f9wmN95xpJ4zrwQ9KoJmSuzrikuHxfxu5hRjsLs=; b=XcxTDfna3bm+3MPaz38ZL33sbcdA8vmiM0xqP7l+Kt7aC/BrdSvWvQvgMLTnWZHxv5 klxIp3/eII+LClF11kaRBWOJ+V9+Q7S3OQF0pPZh1OBKz5/H/kbZY8jPHBBerATbVliS JKneBqsUH8PJFeRzFKi9QW+USQxHKO3H1MYNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :content-type:content-transfer-encoding:content-disposition :message-id; b=rIHm1vr2YOYxdPoXR6bSe2xk85DKWbS+sc6+tYkO/3JA+/JLtFDdsGrfhdMFXGYZoX svgL6tmzxPC7ahagp+zTmbEyusdkVKaf74Z46E6n/Cep19i1LKbE8HrkUM6juyhzikYN LSLAOYtgfBrGsFj23/RlANj/BzfGp7rS7r5x4= Received: by 10.90.29.13 with SMTP id c13mr884544agc.109.1238120137234; Thu, 26 Mar 2009 19:15:37 -0700 (PDT) Received: from ?192.168.0.102? (c-98-219-43-7.hsd1.ga.comcast.net [98.219.43.7]) by mx.google.com with ESMTPS id 20sm1429499agb.63.2009.03.26.19.15.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Mar 2009 19:15:36 -0700 (PDT) From: Peng Zang Reply-To: peng.zang@gmail.com To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Toplevel with camlp4 Date: Thu, 26 Mar 2009 22:15:32 -0400 User-Agent: KMail/1.9.9 Cc: Andre Nathan , caml-list@inria.fr References: <1238119160.6000.7.camel@homesick> In-Reply-To: <1238119160.6000.7.camel@homesick> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903262215.35389.peng.zang@gmail.com> X-Spam: no; 0.00; toplevel:01 camlp:01 hash:01 ocaml:01 bug:01 descriptors:01 toploop:01 toplevel:01 argv:01 toploop:01 argv:01 ocamlc:01 toplevellib:01 foo:01 val:01 -----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-----