From d4d21b42799d49eb401b90ff05fd1661e06a1d3b Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 14 Feb 2012 09:28:10 -0800 Subject: [PATCH] tutorial: Mention how the destructor works in the section on resources. Closes #1615. --- doc/tutorial.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index ad6dd68d823..4cad3cd2009 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1329,10 +1329,11 @@ resource file_desc(fd: int) { ~~~~ This defines a type `file_desc` and a constructor of the same name, -which takes an integer. Values of such a type can not be copied, and -when they are destroyed (by going out of scope, or, when boxed, when -their box is cleaned up), their body runs. In the example above, this -would cause the given file descriptor to be closed. +which takes an integer. The type has an associated destructor procedure, +whose contents are specified by the block. Values of such a type can not +be copied, and when they are destroyed (by going out of scope, or, when +boxed, when their box is cleaned up), their body runs. In the example +above, this would cause the given file descriptor to be closed. NOTE: We're considering alternative approaches for data types with destructors. Resources might go away in the future.