add retry combinator to combinators.lib

db4
Doug Coleman 2008-02-28 15:42:34 -06:00
parent 48e305ee49
commit fbfa1f8de9
1 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,8 @@
! See http://factorcode.org/license.txt for BSD license.
USING: kernel combinators namespaces quotations hashtables
sequences assocs arrays inference effects math math.ranges
arrays.lib shuffle macros bake combinators.cleave ;
arrays.lib shuffle macros bake combinators.cleave
continuations ;
IN: combinators.lib
@ -167,3 +168,6 @@ MACRO: construct-slots ( assoc tuple-class -- tuple )
: and? ( obj quot1 quot2 -- ? )
>r keep r> rot [ call ] [ 2drop f ] if ; inline
: retry ( quot n -- )
swap [ drop ] swap compose attempt-all ;