epatrizio / ola

OCaml Lua Interpreter
The Unlicense
1 stars 1 forks source link

Bug recursive function #14

Closed epatrizio closed 4 months ago

epatrizio commented 1 year ago

Check example Fibonacci -- 2: Recursive version with memoization https://github.com/epatrizio/ola/blob/main/examples/fibonacci.lua

Memoization does not work:

local fib = fibo2(n-1) + fibo2(n-2)
mem[n] = fib

the trouble seems to be at the double recursive call level ...

epatrizio commented 4 months ago

Check #21 pull request (closure implementation)