How can I use arrays in scheme?
In particular, I'm attempting to implement a recursive fibonacci procedure using memoization. Do arrays even exist in scheme?
If not, how can I implement memoization?
How can I use arrays in scheme?
In particular, I'm attempting to implement a recursive fibonacci procedure using memoization. Do arrays even exist in scheme?
If not, how can I implement memoization?
There are arrays in Scheme, but they are called vectors. Be aware that they don't resize like they do in other languages like Perl and Javascript, or the like-named C++ thing; you have to make a bigger one and copy the contents of the obsolete one over.
If you want to know more about memoization and dynamic programming in particular, you can read chapter 12 of the free book Concrete Abstractions.
This is not a direct answer, so feel free to downvote etc: if you're using PLT and you need memoization then you should look at Dave Herman's memoize package. Also, you could grab the memoize function from the swindle library.