add retry combinator to combinators.lib
parent
48e305ee49
commit
fbfa1f8de9
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue