[m-dev.] for review: fixing formatting of HLDS dumps
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Feb 19 10:58:24 AEDT 1999
On 19-Feb-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Thu, Feb 18, 1999 at 07:47:53PM +1100, Fergus Henderson wrote:
> > It would be better, IMHO, to use an error message
> > like this:
> >
> > ...
> > foo.m:001: error: undefined symbol `\n /0'.
> >
> > (Trying to print out the symbol name in quotes, i.e.
> >
> > foo.m:001: error: undefined symbol `'\n '/0'.
> >
> > would be worse, IMHO.)
>
> I think either
>
> foo.m:001: error: undefined symbol '\n '/0.
>
> or
>
> foo.m:001: error: undefined symbol `\n '/0.
>
> would be much better (but preferably the first).
In this particular case, I agree. But you have to look
at the global picture. Error messages like this one
are *very* infrequent, so it's worthwhile to do
worse on this error message if it means that we can
do a little bit better on most other error messages.
> And for consistency
>
> foo.m:001: error: undefined symbol foo/0.
>
> seems perfectly understandable.
That is what we used initially, but our experience was
that using `...' made the error messages easier to read.
> Alternatively
>
> foo.m:001: error: undefined symbol: foo/0.
>
> might be a little clearer.
That doesn't work so well for error messages where there
are more than one symbol that we need to name.
> In any case
>
> foo.m:001: error: undefined symbol `\n /0'.
>
> seems pretty confusing. What will the user think when the error is a
> little different and she reads:
>
> foo.m:001: error: undefined symbol `\n /0/0'.
>
> ?
That example is not likely to occur in real life.
A much more realistic example is this one:
foo.m:001: error: undefined symbol `//2'.
The ideal thing to do would be to use bold type or a special
colour, rather than using `...'. That would avoid abominations
like
foo.m:001: error: undefined symbol `'/'/2'.
while still keeping the appropriate emphasis in the usual case.
Unfortunately, however, there's no portable way of doing that.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh> | but source code lives forever"
PGP: finger fjh at 128.250.37.3 | -- leaked Microsoft memo.
More information about the developers
mailing list