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
|
] unit-test
|
||||||
|
|
||||||
[ 3 ] [ always-counter get ] unit-test
|
[ 3 ] [ always-counter get ] unit-test
|
||||||
[ 2 ] [ error-counter get ] unit-test
|
[ 1 ] [ error-counter get ] unit-test
|
||||||
] with-scope
|
] with-scope
|
||||||
|
|
|
@ -127,8 +127,8 @@ PRIVATE>
|
||||||
>r (catch) r> ifcc ; inline
|
>r (catch) r> ifcc ; inline
|
||||||
|
|
||||||
: cleanup ( try cleanup-always cleanup-error -- )
|
: cleanup ( try cleanup-always cleanup-error -- )
|
||||||
>r [ compose (catch) ] keep r> compose
|
over >r compose [ dip rethrow ] curry
|
||||||
[ dip rethrow ] curry ifcc ; inline
|
>r (catch) r> ifcc r> call ; inline
|
||||||
|
|
||||||
: attempt-all ( seq quot -- obj )
|
: attempt-all ( seq quot -- obj )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue