[m-dev.] special module initialisation code

David Overton dmo at cs.mu.OZ.AU
Fri Mar 31 16:53:30 AEST 2000


On Fri, Mar 31, 2000 at 03:55:24PM +1000, Tyson Dowd wrote:
> 
> Typically I solve this problem by making the delcarative interface do
> the initializtion.  This can be done in the equivalent of the data
> structure initialization function (if you thread a data structure to
> each operation).

There is no data structure threaded through each operation in this
case.

> Alternately, if there is no data struction initialization, you can do a
> "first-time" test for each operation.  It's not clear whether this would
> be too expensive for your application.

I thought about this.  It probably wouldn't be too expensive in this
case (Peter Schachte, do you have any comments on this?).

At the moment I've implemented Fergus's suggestion of using a C++
global variable whose constructor does the initialisation.  This seems
to be working well, but has the disadvantage that the initialisation
is done even when it is not needed for a particular run of the
program.


David
--
David Overton      Department of Computer Science & Software Engineering
PhD Student        The University of Melbourne, Victoria 3010, Australia
+61 3 8344 9159    http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list