I just saw an error from a program that normally runs fine:
------------------------------------------------------
->unicon ar.icn
Parsing ar.icn: ...
/opt/unicon/bin/icont -c -O ar.icn /tmp/uni79296127
Translating:
ar.icn:
main
fib
makeProc
No errors
/opt/unicon/bin/icont ar.u
Linking:
->ar 8
fib(8)=34
System error at line 5 in ar.icn
The value specified by mutex does not refer to an initialised mutex object.
->ar 8
fib(8)=21
->ar 8
fib(8)=21
->
----------------------------------------------
Also note that the value output just prior to the error is incorrect,
as if it went through one too many 'recursive' co-expression activations.
Unfortunately, I can't reproduce it consistently (it *rarely* occurs)
The offending program is attached.
--
Steve Wampler -- [email protected]
The gods that smiled on your birth are now laughing out loud.
procedure main(A)
every write("fib(",a := numeric(!A),")=",fib(a))
end
procedure fib(n)
static ifib
local source, i, x
ifib := makeProc {
repeat {
source := &source
i := (n@source)[1]
if i = (0|1) then i@source
x := (i-1)@makeProc(^ifib)
x +:= (i-2)@makeProc(^ifib)
x@source
}
}
if type(n) == "integer" & n >= 0 then
return ifib(n)
end
procedure makeProc(A)
if type(A) == "co-expression" then # Not called as a PDCO!
return (@A,A)
return (@A[1], A[1]) # prime and return
end
------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group