[e-lang] Content Complete, Ready for Comments
David Hopwood
david.nospam.hopwood at blueyonder.co.uk
Thu Jun 30 01:54:25 EDT 2005
Mark Miller wrote:
> David Hopwood wrote:
>
>> # var flag := null
>> # def epimenides() { return flag <- not() }
>> # flag := epimenides <- run()
>
>> ? The code using 'var flag' immediately throws a null reference
>> exception; this is not a datalock bug, because 'flag' is already
>> bound in the call to "flag <- not()".
>
> Actually, the above code does not throw an exception, and does cause a
> datalock. Do you see why?
Er, no. I'm probably being dense, but:
$ cat epimenides.e
#!/usr/bin/env rune
pragma.disable("explicit-result-guard")
var flag := null
def epimenides() { return flag <- not() }
flag := epimenides <- run()
$ ./epimenides.e
***-----------------------***
*** Trace data written to ***
'C:/Documents and Settings/David Hopwood/Local Settings/Temp/etrace/etrace.2005-
06-30T05_45_01.546Z.txt'
***-----------------------***
$ cat "c:/documents and settings/david hopwood/local settings/temp/etrace/etrac
e.2005-06-30t05_45_01.546z.txt"
=== 2005-06-30T05:45:06.296Z (PendingEvent.report:PendingEvent.java:109) WRN
causality: Problem in turn <<Vat start in <runs in start>>,92>:
--vvvv--
<null>.not/0
java.lang.NoSuchMethodException: <null>.not/0
at org.erights.e.elib.prim.VTable.shorten(VTable.java:197)
at org.erights.e.elib.prim.E.callAll(E.java:166)
at org.erights.e.elib.vat.PendingDelivery.innerRun(PendingDelivery.java:102)
at org.erights.e.elib.vat.PendingEvent.run(PendingEvent.java:76)
at org.erights.e.elib.vat.HeadlessRunner.run(HeadlessRunner.java:176)
at java.lang.Thread.run(Unknown Source)
--^^^^--
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.
--
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the e-lang
mailing list