[m-dev.] delaying compile errors until runtime

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Thu Dec 23 12:43:30 AEDT 1999


schachte at cs.mu.OZ.AU writes:
> 
> On 22 Dec, Fergus Henderson wrote:
> > It might be nice to add an option to the Mercury compiler
> > that would cause it to go ahead and generate executable
> > code anyway, even if compile errors were found.  The generated
> > code would then raise exceptions at runtime, if/when it was
> > executed.

Sounds OK.  Presumably the compiler would still report the errors
(or maybe turn them into warnings).  I think the use of this
option should generate a warning, regardless of whether any compile
errors were found.  It's also probably worth generating a warning
any time such code is called, like we do for obsolete predicates.

> This is a good idea.  I think it might be a bit better, though,
> to provide some finer-grain mechanism than a compiler switch.  Perhaps
> a pragma to turn this on and off, so one could bracket experimental or
> half-coded parts of ones code with these pragmas, and still have the
> compiler refuse to compile bits of code that are expected to be
> correct.  I know:  this is my usual reaction that this sort of
> information (that parts of the program is expected to have errors)
> belongs in the source code, not in the makefile.

I agree.  It would be like an "XXX" that the compiler understands.

Cheers,
Mark
-- 
Mark Brown, PhD student            )O+  |  "Another of Fortran's breakthroughs
(m.brown at cs.mu.oz.au)                   |  was the GOTO statement, which was...
Dept. of Computer Science and Software  |  uniquely simple and understandable"
Engineering, University of Melbourne    |              -- IEEE, 1994
--------------------------------------------------------------------------
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