chiark / gitweb /
doc/concepts.tex: Warn about allocating resources in init methods.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 2 Aug 2017 09:52:06 +0000 (10:52 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2018 18:58:40 +0000 (19:58 +0100)
doc/concepts.tex

index f7283e4a6069d781f5eb35af81d79257a375fd55..b48746eb138639fd77a9fe1354da89b3afa74647 100644 (file)
@@ -741,7 +741,11 @@ environment in which it operates.
 
 Details of initialization are necessarily class-specific, but typically it
 involves setting the instance's slots to appropriate values, and possibly
-linking it into some larger data structure to keep track of it.
+linking it into some larger data structure to keep track of it.  It is
+possible for initialization methods to attempt to allocate resources, but
+this must be done carefully: there is currently no way to report an error
+from object initialization, so the object must be marked as incompletely
+initialized, and left in a state where it will be safe to tear down later.
 
 Initialization is performed by sending the imprinted instance an @|init|
 message, defined by the @|SodObject| class.  This message uses a nonstandard