static variable
- Posted by coconut Jan 07, 2011
- 1037 views
better to start new thread...
So what I envision is like C static inside function
--fibonacci generator function fibo() static atom a=0,b=1 atom tmp tmp=b b=a+b a=tmp return b end function -- print 10 first terms of fiboacci serie for i=1 to 10 do ? fibo() end for
Here a and b should be stored and initialized as any top level variable but they are only visible inside fibo() function. This can be managed at front end. There is no need for special storage class.
Jacques