Hello,

I just found it (in ghci and hugs) that this is a valid haskell program:
let 0 = 1 in 0

This program evaluates to 0 (to my surprise).

I expected something similar to how this works:
let { 1 + 1 = 3; 3 + 1 = 7 } in 1 + 1 + 1

Where you get 7.

So, if the 0 is not used as an identifier (ie, defining a function or
name of a value), then why doesn't this count as a parse error?  And,
why didn't I get to locally redefine it?

Thanks,
Jason
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to