[racket] handy trick for "amb-collect" desired

From: Stefan Busch (stefan_busch_ at arcor.de)
Date: Sun Sep 12 10:16:11 EDT 2010

Hello racket community,

though it may be impolite to enter the community with a wish,
I'd like to ask for help with the following problem:


I want a and b to "run through" all elements of two given lists,
and then to catch the combinations that fullfill a desired condition with
an "amb-assert" statement.

If I try this in the following way

(amb-collect
(let ((a (amb *someList*)
        (b (amb *someDifferentList*))...............

it turns out that not the list elemets are considered possible values 
for a or b,
but the lists themselves are treated as the only possible value.

In all examples I could find for the uage of "amb-collect" the values to 
run through were
recited, but in my case these are quite many, so would be grateful for a 
handier solution.

thanks,
Stefan







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100912/1d519035/attachment.html>

Posted on the users mailing list.