Name:
Anonymous
2013-08-01 16:07
screen 12
dim as integer i = 0
dim as ulongint a = 0, b = 1, c = 0
input "? ", i
while i >= 0
print a; " ";
c = b
b = a + b
a = c
i -= 1
wend
sleep
And they said BASIC wasn't useful for anything.
Name:
Anonymous
2013-08-01 16:51
>>2
Won't you get some kind of stack overflow error at some point? Because like, the stack can only hold so many thunks or what not.
Name:
Anonymous
2013-08-01 18:03
>>3
I'm pretty sure, Haskell compiler has hardcoded optimization for these simple usage cases, but in general case it would fail.