runhugs broken

Ross Paterson ross@soi.city.ac.uk
Thu, 15 May 2003 21:16:40 +0100


On Thu, May 15, 2003 at 11:29:24AM -0700, Iavor Diatchki wrote:
> here is for the weekly bug :-) the program:
> 
> > import Prelude(print)
> > main = do print "hello"
> >           print "world"
> 
> works fine with hugs, but when executed with runhugs it fails with:
> runhugs: Error occurred
> ERROR - Undefined variable ">>"
> 
> the do-notation translation should magically refer to the prelude and 
> not what is in scope.  i would have though that runhugs is reusing the 
> same code as hugs...

It's not the do-notation -- you get the same with

> import Prelude(print)
> main = print "hello"

The problem is the following line in runhugs.c:

    hugs->pushHVal(hugs->compileExpr("Main","main >> return ()"));