Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memoization #6

Open
tuturto opened this issue Apr 8, 2016 · 1 comment
Open

memoization #6

tuturto opened this issue Apr 8, 2016 · 1 comment

Comments

@tuturto
Copy link
Owner

tuturto commented Apr 8, 2016

Functions could memoize (automatically?, based on keyword?), so successive calls with same parameters wouldn't have to be computed, but could be returned from cache instead.

@tuturto
Copy link
Owner Author

tuturto commented Jun 15, 2016

=> (define n!
...  (memoize
...    (lambda (n)
...      (cond ((= n 0) 1)
...            (#t (* (n! (- n 1)) n))))))
<closure: n>
=> (n! 0)
1
=> (n! 4)
24

Pitäisikö memoisaatio näkyä tyypistä?

<closure: n>
vs
<closure (memoized): n>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant