On 07/21/2011 08:34 AM, Steve Wampler wrote:

I just saw an error from a program that normally runs fine:
...
Unfortunately, I can't reproduce it consistently (it *rarely* occurs)

The offending program is attached.

This version seems to hit the problem more often.  I'm assuming
that the differing errors are really symptoms of the same problem:
-----------------------------------------------------------
->ar 12
warning ce title is 46915092228296

Run-time error 302
File ar.icn; Line 14
memory violation
Traceback:
   fib(12) from line 2 in ar.icn
   {^co-expression_2(0)} from line 14 in ar.icn
->ar 12
fib(12)=144
->ar 12
fib(12)=144
->ar 12
fib(12)=144
->ar 12
fib(12)=158
System error at line 13 in ar.icn
The value specified by mutex does not refer to an initialised mutex object.
->
-----------------------------------------


--
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)
                 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 n@ifib
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

Reply via email to