Version française
Home     About     Download     Resources     Contact us    
Browse thread
Controlling module loading order.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Re: [Caml-list] Controlling module loading order.
Gerd Stolpmann a écrit :
> Hi Guillaume,
> 
> 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
> 
> let init() = ()
> 
> By calling this function the user references the interpreter, and all
> the initialization code is executed.

That's exactly what I want to avoid.

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/