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=AWL 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 CE7FCBB84 for ; Mon, 8 Sep 2008 17:06:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroDAEPcxEjAXQIniGdsb2JhbACSRQEBAQ8goneBZg X-IronPort-AV: E=Sophos;i="4.32,358,1217800800"; d="scan'208";a="16707381" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Sep 2008 17:06:14 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m88F6C2L014822 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 8 Sep 2008 17:06:14 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AroDAK/cxEiBrw8EiGdsb2JhbACSRQEBAQ8gowCBZg X-IronPort-AV: E=Sophos;i="4.32,359,1217800800"; d="scan'208";a="14702222" Received: from ext.lri.fr ([129.175.15.4]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 08 Sep 2008 17:06:03 +0200 Received: from localhost (localhost [127.0.0.1]) by ext.lri.fr (Postfix) with ESMTP id F3302A44D6 for ; Mon, 8 Sep 2008 17:06:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lri.fr Received: from ext.lri.fr ([127.0.0.1]) by localhost (ext.lri.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dr4xjfcGrPaB for ; Mon, 8 Sep 2008 17:06:02 +0200 (CEST) Received: from smtp.lri.fr (vhost3-23 [129.175.3.23]) by ext.lri.fr (Postfix) with ESMTP id DD954A4388 for ; Mon, 8 Sep 2008 17:06:02 +0200 (CEST) Received: from [129.175.4.107] (lri4-107 [129.175.4.107]) by smtp.lri.fr (Postfix) with ESMTP id D83FBE0555 for ; Mon, 8 Sep 2008 17:06:02 +0200 (CEST) Message-ID: <48C53F7F.4090805@lri.fr> Date: Mon, 08 Sep 2008 17:06:39 +0200 From: Romain Bardou User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: OCaml Subject: Re: [Caml-list] Replacing Pervasives? References: <1220861166.11009.7.camel@Blefuscu> <1220865475.11009.12.camel@Blefuscu> <48C4F8BB.60408@lri.fr> <1220871079.11009.18.camel@Blefuscu> In-Reply-To: <1220871079.11009.18.camel@Blefuscu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 48C53F64.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lri:01 pervasives:01 0200,:01 stdlib:01 ocamlc:01 ocamlc:01 -nostdlib:01 pervasives:01 cmo:01 stdlib:01 cmo:01 makefile:01 -ocamlc:01 plug-in:98 wrote:01 David Teller a écrit : > Would that open anything by default? > > > On Mon, 2008-09-08 at 12:04 +0200, Romain Bardou wrote: >> I guess you could try and make your own stdlib directory, and then >> call >> ocamlc using: >> >> ocamlc -nostdlib -I mystdlib >> >> or something like that... >> My guess is that it would try to open mystdlib/Pervasives.cmo... In other word it's as if you changed your "official" stdlib/Pervasives.cmo except that it's cleanier as you don't actually override it (which would change your Pervasives for all your projects). I didn't try it though, so maybe I'm missing something. Another way to automatically open your module would be to do a weird Makefile such as: %.cmo: %.ml echo "open Myperv;;\n" > $*.temp.ml cat $*.ml >> $*.temp.ml ocamlc -c $*.temp.ml -o $*.cmo rm $*.temp.ml Or you could do this using some Ocamlbuild plug-in, or just by using the -ocamlc option of Ocamlbuild... Basically, just use any hack which can replace your ocamlc by a script which adds "open Myperv;;\n" before calling ocamlc ^^ -- Romain Bardou