[m-dev.] .opt files and contexts

Simon Taylor stayl at cs.mu.OZ.AU
Wed Jan 24 10:04:04 AEDT 2001


> On 23-Jan-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > Is there a reason why there are no real contexts in .opt and .trans_opt
> > files?  
> > 
> > E.g.
> > 
> > 	:- pragma source_file("foo.m").
> > 	#42
> > 	< some item from line 42 of the foo.m file >
> > 
> > Is this just an oversight, or is it a deliberate design decision?
> 
> I think `.opt' files predate `:- pragma source_file' and `#<LINE>'
> directives.  AFAIK this has not been considered before.
> 
> In general I think errors in .opt and .trans_opt files should be rare,
> since most errors should be detected before producing those files.
> And including `:- pragma source_file' and `#<LINE>' directives
> may increase the time it takes to produce and parse those files.
> Getting the contexts right in all cases may be difficult.
> It may perhaps be worthwhile nonetheless, but given the potential
> drawbacks I would rate that one as a very low priority.

I think the main reason was that the contexts would cause unnecessary
recompilation if the contexts were the only thing that changed when
a `.opt' file was rebuilt.

It would be fairly simple to produce a version of mercury_update_interface
that ignores `#<LINE>' directives, but that would leave inaccurate contexts
in the `.opt' files which are probably worse than no contexts.

Simon.

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