VocabularydestructorsInputs and outputs| disposable | a disposable object |
Generic word contractReleases operating system resources associated with a disposable object. Disposable objects include streams, memory mapped files, and so on.
No further operations can be performed on a disposable object after this call.
Disposing an object which has already been disposed should have no effect, and in particular it should not fail with an error. To help implement this pattern, inherit from the
disposable class and implement the
dispose* method instead.
NotesYou must dispose of disposable objects after you are finished working with them, to avoid leaking operating system resources. A convenient way to automate this is by using the
with-disposal word.
The default implementation assumes the object has a
disposed slot. If the slot is set to
f, it calls
dispose* and sets the slot to
t.
DefinitionMethods