ASH HAFEZ wrote:
>
> during testing of an interpreter i'm currently working on, i uncovered the
> following bug in Hugs98.
>
> define and load the following function :
>
> f ~[x] = [x]
>
> the application of f to such things as [i, j .. k], enumFromTo i j, or
> list comprehensions have failed to produce the correct result --- a
> program error. Instead, some sort of infinite dump is thrown to screen.
You are stating that f's argument will always have
one (and only one) argument. Is this what you intended?
(I believe that using f ~[x] is the same as using f ~(x:~[]))
Under these conditions it is correct for the interpreter
to give an error for the likes of
f [1,2]
For our part, the error message we give could
be clearer, though. GHC gives the message:
Fail: bug.hs:2: Irrefutable pattern failed for pattern [x]
Hope this helps. If not, can you e-mail Hugs-bugs with
a specific example of failure, and why you think its
a problem.
Andy