[m-dev.] for review: rewrite of termination analysis (part 1)

Fergus Henderson fjh at cs.mu.oz.au
Mon Dec 22 19:14:58 AEDT 1997


On 22-Dec-1997, Zoltan Somogyi <zs at cs.mu.oz.au> wrote:
> 
> > > 		require(unify(PPId, CallerPPId), "caller outside this SCC"),
> > 
> > I think you should spell out "SCC".
> 
> This is an internal compiler abort message. Users should never see this;

Oh, fine.  Sorry, I didn't notice that.

> > > term_errors__describe_one_call_site(PPId - Context, Module, Piece) :-
> > > 	term_errors__describe_one_proc_name(PPId, Module, ProcName),
> > > 	Context = term__context(FileName, LineNumber),
> > > 	string__int_to_string(LineNumber, LineNumberPart),
> > > 	string__append_list([
> > > 		ProcName,
> > > 		" at ",
> > > 		FileName,
> > > 		":",
> > > 		LineNumberPart
> > > 		], Piece).
> > 
> > Term contexts should always be printed in the left-hand margin,
> > so that tools like `emacs' and `error' can parse them.
> 
> Not in this case. We want to describe the cycle in a way that will not cause
> error to scatter the various components of the one error message describing
> the cycle over the entire program. If it did, the result would not be
> intelligible, especially if some call sites participate in several cycles.

I think the ideal solution for this sort of case is to make the error message 
look something like either this:

	foo.m:042: Some complex error occurred in either
	foo.m:042:   p/2 or q/3 or r/4.
	bar.m:025: This is the location of p/2.
	baz.m:036: This is the location of q/3.
	qux.m:036: This is the location of r/4.

or this:

	foo.m:042: Some complex error occurred in either
	foo.m:042:   p/2 (at bar.m:025) or q/3 (at baz.m:036)
	foo.m:042:   or r/4 (at qux.m:049).
	bar.m:025: This is the location of p/2.
	baz.m:036: This is the location of q/3.
	qux.m:036: This is the location of r/4.

This doesn't help much when using `error', but it helps quite a bit
if you're using emacs, or elvis, or just about any decent IDE.

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



More information about the developers mailing list