I wrote a macro which can take a list and pass it into the "amb" operator.
(define-syntax amb-list
(syntax-rules ()
((_ l) (eval `(amb ,@l)))))
There is another useful function for lists.
(define (zip a b)
(let loop ((l '()) (al a) (bl b))
(cond ((not (equal?
(list-length al)
(list-length bl))) #f)
((null? al) l)
(else (loop (append l (list (cons (car al) (car bl))))
(cdr al) (cdr bl))))))
(define a (list 1 2 3))
(define b (list 4 5 6))
(zip a b) => ((1 . 4) (2 . 5) (3 . 6))
It interleaves elements from two lists and make a new list.
In my eyes, mathematics is a bridge between our living real physical world and our mental world.
In middle ages, and in roman ages, people had just concerned on one of them. So, curiosity and
free mind were ignored or prohibitten. Mathematics can not grown up.