Version française
Home     About     Download     Resources     Contact us    
Browse thread
convenient features
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <Pierre.Weis@i...>
Subject: Re: convenient features
> On Wed, 28 Jun 2000, David Chemouil wrote:
> > 1. One thing that really bothers me is the obligation to put object
> > files in the good order, when linking them.
> 
> To my knowledge the reason for this is that you might otherwise have
> difficulties with linking, because some library may contain a module
> with the same name. By requiring correct order of files during linking,
> it is possible to "override" the names provided in libraries or earlier
> on the command line. E.g., if you want to use a different implementation
> for sets, just link against some other set.cmo: it overrides whatever
> was used before.

You're right, but also don't forget that toplevel expressions in
modules are executed in the order of presentation (and recursively,
that is in each module, for all the modules that are linked together).

This way, if init.ml contains the expression initialize ();;
and main.ml contains exit 0;; as its last phrase, then linking init.cmx
before main.cmx ensures that initialization is performed before
exiting the program.

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/