On Wed, 2012-03-14 at 18:23 -0600, Alan Post wrote:
> [...]
>   (pretty-print (let ((s (amb 0 1 2))) (amb-collect s)))
> [...]
> produces:
> [...]
>   (0)
> [...]

Hello,

to me this behaviour looks correct. amb-collect is supposed to collect
all the different values its argument can take on, but in your example s
is not an ambivalent expression -- the fact that s is bound to a value
produced by amb only makes the let expression ambivalent.

To phrase it more technically: Every amb-collect creates a new dynamic
scope for backtracking. Any ambivalence introduced in that dynamic scope
will be resolved and the results will be collected but any outer dynamic
scope will not be affected.

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to