in reply to Re: how can i hold temporary values in a recursive function
in thread how can i hold temporary values in a recursive function

For that case, also see Memoize

  • Comment on Re^2: how can i hold temporary values in a recursive function

Replies are listed 'Best First'.
Re^3: how can i hold temporary values in a recursive function
by LanX (Saint) on Apr 18, 2010 at 16:59 UTC
    I suppose he needs a more general flexibility to memoize based on more complicated input ("Level"?) Thats why I didn't mention Memoize

    For those interested see Viterbi Algorithm and Algorithm-Viterbi

    Cheers Rolf

      You can pass a key-generator function to Memoize in case you need to normalize your parameters. Personally, I would add the "level" as another parameter and use plain Memoize.

        Sure, but I have no big clue what siskos1 really needs, so a general introduction to closure and caching states might (?) lead to a solution to another problem, where Memoize is already too specialized.

        Cheers Rolf