cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: [forms] recursive event loops
Date Thu, 15 Apr 2004 14:49:45 GMT
UnrealScript solves this another way:

    http://unreal.epicgames.com/UnrealScript.htm:
    Singular: The "singular" keyword, which appears immediately 
    before a function declaration, prevents a function from 
    calling itself recursively. The rule is this: If a certain 
    actor is already in the middle of a singular function, any 
    subsequent calls to singular functions will be skipped over. 
    This is useful in avoiding infinite-recursive bugs in some 
    cases. For example, if you try to move an actor inside of 
    your "Bump" function, there is a good chance that the actor 
    will bump into another actor during its move, resulting in 
    another call to the "Bump" function, and so on. You should 
    be very careful in avoiding such behaviour, but if you can't 
    write code with complete confidence that you're avoiding 
    such potential recursive situations, use the "singular" 
    keyword.

Disclaimer: I can't write UnrealScript to save my life, so I
don't know how useful this is in reality.

/LS

> From: Bruno Dumon [mailto:bruno@outerthought.org] 


Mime
View raw message