On Thu, Mar 22, 2012 at 08:12:08PM +0000, Richard W.M. Jones wrote:
> On Thu, Mar 22, 2012 at 06:14:03PM +0100, Pierre Chambart wrote:
> > On 03/22/2012 05:42 PM, Richard W.M. Jones wrote:
> > > Any ideas on how best to go about this? Note that the whenjobs jobs
> > > script is intentionally a Turing-complete OCaml program, so converting
> > > it to another format is probably not going to be practical.
> > >
> > I did not really read your code, but it seams to me that you are doing
> > the compilation in your tool.
> > So you can choose the name of the module. Isn't it possible to change
> > the name of the file each
> > time you compile/reload it ?
>
> Yes, I guess something involving -pack to pack all the files into
> a randomly-named submodule, could be the way to go.
Just to follow up on this. I implemented this by packing all my files
into a randomly-named module. ie. My files are compiled using the
-pack/-for-pack options as submodules of 'Jobs__<time>' where <time>
is the current time_t. The top (randomly named) module is then loaded.
This works fine in both bytecode and native code.
The code is here:
http://git.annexia.org/?p=whenjobs.git;a=commitdiff;h=de72662854c3db9365296dd45cade2253910be7f
Rich.
--
Richard Jones
Red Hat