It would always be (a b 1).
(a b 1)
(define (analyze-if-fail exp) (let ((first (analyze (cadr exp))) (second (analyze (caddr exp)))) (lambda (env succeed fail) (first env (lambda (value fail2) (succeed value fail2)) (lambda () (second env succeed fail))))))
(let ((pairs '())) (if-fail (let ((p (prime-sum-pair '(1 3 5 8) '(20 35 110)))) (permanent-set! pairs (cons p pairs)) (amb)) pairs))
pairs would collect all the combinations of the two lists. (amb) would force iterate all the valid pairs which would be returned.
pairs
(amb)
(define (analyze-require exp) (let ((pproc (analyze (require-predicate exp)))) (lambda (env succeed fail) (pproc env (lambda (pred-value fail2) (if (not (true? pre-value)) (fail2) (succeed 'ok fail2))) fail))))