Re:Once you go functional, you can never go back
by gus_massa on Monday May 18, 2015 @10:24AM
(#9564591)
Racket doesn't have a built-in memorization, but you can define a "define/mem" macro to handle the memorization details and you can reuse it later. This way, the example of the article runs in O(n) time without other changes:
But be careful, because this is O(n) in memory because the calculated values are never collected.
[ Parent
| on HN ]
There are no comments on this comment yet.