[m-dev.] for review: clean up MLDS init functions

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 9 15:13:53 AEDT 2000


On 08-Nov-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> >From Fergus Henderson on 08/11/2000 16:12:45
> > -	mlds_output_init_main_fn(ModuleName, Defns).
> > +mlds_output_calls_to_init_entry(_ModuleName, []) --> [].
> > +mlds_output_calls_to_init_entry(ModuleName, [FuncDefn | FuncDefns]) --> 
> > +	{ FuncDefn = mlds__defn(EntityName, _, _, _) },
> > +	io__write_string("\tMR_init_entry("),
> > +	mlds_output_fully_qualified_name(qual(ModuleName, EntityName)),
> > +	io__write_string(");\n"),
> > +	mlds_output_calls_to_init_entry(ModuleName, FuncDefns).
> > [...]
> 
> It's probably too late to change things now, but it seems to me that
> the pretty-printing library could go a long way to making this more
> readable and maintainable.

Hmm, could you be more specific?

Using the pretty-printing library would help us format the output
to some reasonable number of columns.  But I don't think it would
make much difference to the readability or maintainability of
mlds_to_c.m itself.  (That module is performing a fairly simple
task, since the MLDS is already pretty close to C, so I think it
would be fairly readable and maintainable regardless of how we
do the output.)

> Or is that taking a sledgehammer to a walnut?

Probably.  Anyway last time I looked, the pretty-printing library
has exponential performance for large outputs.  So we'd need to fix
that problem first.

-- 
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