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

improve Scribble's make-log-based-eval? #25

Open
bennn opened this issue Jan 28, 2020 · 0 comments
Open

improve Scribble's make-log-based-eval? #25

bennn opened this issue Jan 28, 2020 · 0 comments

Comments

@bennn
Copy link
Owner

bennn commented Jan 28, 2020

Frow WJB:

FWIW, I used this function to implement a caching version that has better
(more automagic) behavior than make-log-based-eval.
You can add it to with-cache if you think it's useful/a good place for it.

(define (make-cached-eval name . rest)
  (define ev
    (make-log-based-eval
     (cachefile name)
     (if (file-exists? (cachefile name))
         'replay
         'record)))
  (for ([r rest])
    (ev r))
  ev)

The function doesn't use with-cache, but might be a good package addition. William was looking for behavior like make-log-based-eval and came to with-cache, so at least a docs pointer could be useful.

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

No branches or pull requests

1 participant