From 819234bedd656be7f014efb869e06744c2d7ab9a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 16 Sep 2008 22:55:26 -0500 Subject: [PATCH] document dispose-each --- core/destructors/destructors-docs.factor | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/destructors/destructors-docs.factor b/core/destructors/destructors-docs.factor index b611b8ec19..c82f92dc10 100755 --- a/core/destructors/destructors-docs.factor +++ b/core/destructors/destructors-docs.factor @@ -1,4 +1,5 @@ -USING: help.markup help.syntax libc kernel continuations io ; +USING: help.markup help.syntax libc kernel continuations io +sequences ; IN: destructors HELP: dispose @@ -45,6 +46,11 @@ HELP: |dispose { $values { "disposable" "a disposable object" } } { $description "Marks the object for disposal in the event of an error at the end of the current " { $link with-destructors } " scope." } ; +HELP: dispose-each +{ $values + { "seq" sequence } } +{ $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." } ; + ARTICLE: "destructors-anti-patterns" "Resource disposal anti-patterns" "Words which create objects corresponding to external resources should always be used with " { $link with-disposal } ". The following code is wrong:" { $code