Infinitely looping animations...

Pieter Koopman pieter@wi.leidenuniv.nl
Mon, 23 Jun 1997 09:09:02 +0200


At 18:01 -0700 6/21/97, Michael Heacock wrote:
>Nick Kallen wrote:
>>
>> Hi..
>>
>> I've written a program that I want to animate infinitely. The only way
>> I
>> can concieve of doing this is an infinite recursion. Obviously, this
>> is not
>> a good thing, as requiring the user to kill the app using
>> <ctrl><alt><del>
>> (in win95 atleast) is not cool.
>>  Any suggestions?
>>
>> -Nick
>
>You would also run out of resources...most likely a stack error,
>since each recursive call would store yet another set of
>parameters and return addresses onto the stack...


This is not C! The Clean compiler uses a cleaver tail call optimisation
that prevents the use of stack space for functions that just have to return
their value.

Pieter Koopman
Computer Science,
Leiden University, The Netherlands

>--
>Michael Heacock         "Hail hail the lucky ones,
>Praxis Technical Group   I refer to those in love"
>Nanaimo BC Canada                -- Eddie Vedder