[m-dev.] for review: initialize global IO data structures in IL backend

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 7 00:51:28 AEDT 2000


On 06-Nov-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> compiler/mlds_to_il.m:
> 	If the module contains main/2, generate a call to the initialization
> 	function for the io library in the class constructor for this module.
> 	This isn't a perfect solution (it isn't quite a flexible as the
> 	init.c approach if you have more than one main module that contains a 
> 	main/2 predicate) but it works well enough at the moment.
> 
> 	Also, switch to using DCG versions of the field selection and update
> 	syntax, as this is nicer than using =(Info) and dcg_set.

That looks fine, Tyson.

My only comment is that rather than calling
mercury.io.io_init_state_2_p_0() directly, it might be a better idea
to call something like mercury.private_builtin.init_runtime(), and
have that call mercury.io.io_init_state_2_p_0().  That way it's easier
to add additional start-up code if needed.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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