Add amb-all and bag-of

db4
Samuel Tardieu 2009-05-24 15:43:28 +02:00
parent 1b9b27213d
commit cbef12c629
1 changed files with 6 additions and 0 deletions

View File

@ -71,3 +71,9 @@ MACRO: amb-execute ( seq -- quot )
: cut-amb ( -- )
f failure set ;
: amb-all ( quot -- )
[ { t f } amb [ call fail ] [ drop ] if ] amb-preserve ; inline
: bag-of ( quot -- seq )
V{ } clone [ '[ @ _ push ] amb-all ] keep ; inline