On Fri, 10 Sep 1999, Simon Raahauge DeSantis wrote:
> On Fri, Sep 10, 1999 at 07:40:03PM +0200, Jose Emilio Labra Gayo wrote:
> >
> > 1.- Show "some" Warnings
> > -------------------------
[...]
> >
> > As an example, suppose you write a long program and you define:
> >
> > > f = "First definition . . . ."
> >
> > And you define two or more pages below a second and different
> > (while type correct) definition for f
> >
> > > f = "Second definition . . ."
> >
[...]
>
> Have you ever actually had this happen to you? I tried to load the following
> program into hugs:
[...example deleted...]
> And the result I got:
> ERROR "/tmp/foo.hs" (line 1): "l" multiply defined
> I think having function definitions in multiple places is forbidden by the
> report (though I haven't checked).
>
Well, it was just an example. There is a lot of common bugs that the
system can try to detect (I am talking about "warnings", not "errors").
Repeated definitions can be writen as:
f x = "hello"
-- A long comment
f x = "bye"
And the system could report a warning (not an error).
> > 2.- Try to recover from the first error
> > ---------------------------------------
> > Hugs could give a list of [line number]-[error message] instead
> > of reporting only the first error.
>
> My experience with this in C compiliers (Older version of Symantic C/C++
> springs to mind, and also gcc) is that often fixing the first error clears
> up some of the subsequent error reports (ie they were caused by parsing
> breaking down). I think this would be especially true with the layout rule
> and all.
>
I think that it depends on the way you develop your program.
Sometimes you write it interactively (one function each time)
and you only need the first error.
But sometimes you get a whole program and try to compile it.
I remember when I was adapting some programs from Haskell 1.4
to Haskell 98 and It would have been very useful that the system
reported more errors than only the first one.
Regards, Jose Labra
http://lsi.uniovi.es/~labra