OT: Going "huh?!" at Reasoned Schemer

jjore on 2006-12-08T21:32:30

In chapter 1, part 54 I don't understand why the return value is ((split pea) (navy bean)). CONDE returns that but the return value is r unified with (list x y) and it appears the book is trying to say ... uh... that x and y are *both* values now?

Huh?

;; Beware, I speak scheme with a Common Lisp accent
(run* (r)
  (fresh (x y)
    (conde ;; -> ((split pea) (navy bean))
      ((== 'split x) (== 'pea y)) ;; -> (split pea)
      ((== 'navy x) (== 'bean y)) ;; -> (navy bean)
      (else #u))

;; I discarded those bindings, right? (== (list x y) r)))


I'm reading this book so I can understand better how to do logic programming and because it'd be good to learn some scheme along the way as well.


Uh... multiple bindings

jjore on 2006-12-08T21:43:54

Wild. x and y are unified with both values simultaneously.