Added the negative memoization

parent ae64ebf0
......@@ -440,14 +440,24 @@
(fr (<newframe>)))
(if (not val)
(<let> ((n N) (m M))
(.. (cc) (f c))
(<let> ((val2 (mk S c cc)))
(<code>
(<unwind> fr)
(hash-set! (fluid-ref *freeze-map*)
(cons* n m tok) (list X XL N M XX ... val2)))
(<p-cc> val2)))
(<apply> f-true val))))))
(<or>
(<and>
(.. (cc) (f c))
(<let> ((val2 (mk S c cc)))
(<code>
(<unwind> fr)
(hash-set! (fluid-ref *freeze-map*)
(cons* n m tok) (list X XL N M XX ... val2)))
(<p-cc> val2)))
(<let> ((val2 'fail))
(<code>
(<unwind> fr)
(hash-set! (fluid-ref *freeze-map*)
(cons* n m tok) (list X XL N M XX ... val2)))
<fail>)))
(if (pair? val)
(<apply> f-true val)
<fail>))))))
(define (f* f) (letrec ((ret (f-or (s-seq f ret) s-true))) (s-and! ret)))
(define (f+ f) (s-seq f (f* f)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment