Fix cleanup combinator in the case where always-cleanup throws an error
parent
e58cbb2cda
commit
e2f270be70
|
@ -104,5 +104,5 @@ SYMBOL: error-counter
|
|||
] unit-test
|
||||
|
||||
[ 3 ] [ always-counter get ] unit-test
|
||||
[ 2 ] [ error-counter get ] unit-test
|
||||
[ 1 ] [ error-counter get ] unit-test
|
||||
] with-scope
|
||||
|
|
|
@ -127,8 +127,8 @@ PRIVATE>
|
|||
>r (catch) r> ifcc ; inline
|
||||
|
||||
: cleanup ( try cleanup-always cleanup-error -- )
|
||||
>r [ compose (catch) ] keep r> compose
|
||||
[ dip rethrow ] curry ifcc ; inline
|
||||
over >r compose [ dip rethrow ] curry
|
||||
>r (catch) r> ifcc r> call ; inline
|
||||
|
||||
: attempt-all ( seq quot -- obj )
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue