Hello!
On Sat, Sep 11, 1999 at 04:51:35PM +0200, Jose Emilio Labra Gayo wrote:
> [...]
> 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).
In this case yes (a pattern can't ever be matched).
But
f x | some_predicate = "Hello"
f x = "bye" -- or f x | other_predicate = "bye"
can't. The comments inbetween don't matter, as the compiler shouldn't
set some artificial limit on what length of comments is "too" long
between two equations for the same symbol.
> [...]
> > 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.
I also agree, error recovery is a must for compilers (and I judge
hugs as a compiler in this special context, because it reads the
module as a whole before you can perform querys on it). However,
I don't know the details of the Hugs implementation, wrt how
difficult it is to have hugs do error recovery.
Regards, Hannah.