[e-lang] Content Complete, Ready for Comments

Mark Miller markm at cs.jhu.edu
Thu Jun 30 02:26:38 EDT 2005


David Hopwood wrote:
> $ cat epimenides.e
> #!/usr/bin/env rune
> pragma.disable("explicit-result-guard")
> 
> var flag := null
> def epimenides() { return flag <- not() }
> flag := epimenides <- run()
> 
> java.lang.NoSuchMethodException: <null>.not/0

Try adding a

     pragma.enable("easy-return")

to your program. Without this, the lack of a result guard is equivalent to 
:void rather than :any, which is why you're getting that null.


> Oddly,
> def epimenides() :vow[boolean] { return flag <- not() }
> just causes the script to terminate without any output; I didn't look 
> closely
> at what was going on there.

The addition of an explicit result guard caused the lack of easy-return not to 
matter. Your code now datalocks as expected.

-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM



More information about the e-lang mailing list