[m-dev.] .opt files and contexts

Tyson Dowd trd at cs.mu.OZ.AU
Tue Jan 23 23:42:44 AEDT 2001


On 23-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 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.

Well, I'm thinking of foreign_code, foreign_proc and foreign_decls in
particular.

Tracing this back to the actual source file is quite useful, as the
information then makes its way to the C file and your error messages in
C come out nicely.

Not that error messages are hugely important when you are using
intermodule optimization -- but I have another use for the contexts in an
upcoming diff.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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