In a practice, I encountered a problem of memorizing functions. Given a
function f, a memorized version of f, called memo f should cache the
results of f applying on some input. I tried a demo here https://glot.io/snippets/egflakau5h, which shows a generic implementation
of the function memo0 (for memorizing a function of no arguments) and memo1 (for memorizing a function with one argument). Comments are
welcomed.
Also, please delete the line "staload …/gorder_int.dats"On Sunday, July 10, 2016 at 9:15:10 PM UTC-4, Steinway Wu wrote:
Hi,
In a practice, I encountered a problem of memorizing functions. Given a
function f, a memorized version of f, called memo f should cache the
results of f applying on some input. I tried a demo here Memorization with ATS - ATS Snippet - glot.io, which shows a generic implementation
of the function memo0 (for memorizing a function of no arguments) and memo1 (for memorizing a function with one argument). Comments are
welcomed.
Thanks, I forgot to save it after debug. Now it works.On Sunday, July 10, 2016 at 9:38:49 PM UTC-4, gmhwxi wrote:
Please change
memo1
to
memo1<int, int>
Also, please delete the line “staload …/gorder_int.dats”
On Sunday, July 10, 2016 at 9:15:10 PM UTC-4, Steinway Wu wrote:
Hi,
In a practice, I encountered a problem of memorizing functions. Given a
function f, a memorized version of f, called memo f should cache the
results of f applying on some input. I tried a demo here Memorization with ATS - ATS Snippet - glot.io, which shows a generic
implementation of the function memo0 (for memorizing a function of no
arguments) and memo1 (for memorizing a function with one argument).
Comments are welcomed.
I would say that a hash table (instead of a binary search tree) is more
suitable for this form of memoization.On Wednesday, July 13, 2016 at 9:29:42 AM UTC-4, Artyom Shalkhakov wrote:
Hello Steinway,
On Monday, July 11, 2016 at 7:15:10 AM UTC+6, Steinway Wu wrote: