From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 00CA0BC37 for ; Mon, 11 Jan 2010 18:49:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AooCAOLySktV2gB5mWdsb2JhbACDXpd3AQEBAQEICwoHE69mjGmBK4IuVgSJJg X-IronPort-AV: E=Sophos;i="4.49,257,1262559600"; d="scan'208";a="41443119" Received: from emailfrontal2.citycable.ch ([85.218.0.121]) by mail3-smtp-sop.national.inria.fr with SMTP; 11 Jan 2010 18:49:33 +0100 Received: from [192.168.0.12] (unknown [85.218.92.99]) (Authenticated sender: guillaume.yziquel@citycable.ch) by emailfrontal2.citycable.ch (Postfix) with ESMTPA id 7057C834259; Mon, 11 Jan 2010 18:49:30 +0100 (CET) Message-ID: <4B4B6498.3050407@citycable.ch> Date: Mon, 11 Jan 2010 18:49:12 +0100 From: Guillaume Yziquel Reply-To: guillaume.yziquel@citycable.ch User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: Gerd Stolpmann Cc: OCaml List Subject: Re: [Caml-list] Controlling module loading order. References: <4B479BA3.6060300@citycable.ch> <1263211171.17350.7.camel@flake.lan.gerd-stolpmann.de> In-Reply-To: <1263211171.17350.7.camel@flake.lan.gerd-stolpmann.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; guillaume:01 guillaume:01 gerd:01 stolpmann:01 findlib:01 cmo:01 cmx:01 cmxa:01 cmo:01 cmx:01 initialized:01 caml-list:01 cma:01 modules:02 modules:02 Gerd Stolpmann a =C3=A9crit : > Hi Guillaume, >=20 > if you want to control from findlib that a certain function is invoked, > the usual way to do it is to put a .cmo/.cmx file into the "archive" > variables. The problem is that the linker drops all unused modules > from .cma/.cmxa archives, and as a consequence the initialization code > of these modules is not executed. So you could make R.interpreter > a .cmo/.cmx - in this case the module is always initialized. Thank you so much! > The other workaround is to provide an init function in R.interpreter > like >=20 > let init() =3D () >=20 > By calling this function the user references the interpreter, and all > the initialization code is executed. That's exactly what I want to avoid. --=20 Guillaume Yziquel http://yziquel.homelinux.org/