Handbook
Glossary
dispose-each ( seq -- )
Factor handbook
»
The language
»
Deterministic resource disposal
»
Using destructors
Prev:
with-disposal ( object quot -- )
Next:
with-destructors ( quot -- )
Vocabulary
destructors
Inputs
seq
a
sequence
Outputs
None
Word description
Attempts to dispose of each element of a sequence and collects all of the errors into a sequence. If any errors are thrown during disposal, the last error is rethrown after all objects have been disposed.
Definition
USING:
continuations
kernel
sequences
;
IN:
destructors
:
dispose-each
( seq -- )
V{
}
clone
[
[
dispose-to
]
curry
each
]
keep
[
last
rethrow
]
unless-empty
;