]> gitweb.factorcode.org Git - factor.git/commitdiff
destructors: improve docs
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 28 May 2009 00:37:03 +0000 (19:37 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 28 May 2009 00:37:03 +0000 (19:37 -0500)
core/destructors/destructors-docs.factor

index 0b6ca15f3185ba019fd1de6ce5bf93a2494970a4..536ee19c8b6377a3892cb9fb228c6f3021c5138e 100644 (file)
@@ -26,7 +26,7 @@ HELP: with-disposal
 
 HELP: with-destructors
 { $values { "quot" "a quotation" } }
-{ $description "Calls a quotation within a new dynamic scope. This quotation may register destructors, on any object, by wrapping the object in a destructor and implementing " { $link dispose } " on that object type.  After the quotation finishes, if an error was thrown, all destructors are called and the error is then rethrown.  However, if the quotation was successful, only those destructors created with an 'always cleanup' flag will be destroyed." }
+{ $description "Calls a quotation within a new dynamic scope. This quotation may register destructors using " { $link &dispose } " or " { $link |dispose } ". The former registers a destructor that will always run whether or not the quotation threw an error, and the latter registers a destructor that only runs if the quotation throws an error only. Destructors are run in reverse order from the order in which they were registered." }
 { $notes
     "Destructors generalize " { $link with-disposal } ". The following two lines are equivalent, except that the second line establishes a new dynamic scope:"
     { $code