Index: tip/550.md ================================================================== --- tip/550.md +++ tip/550.md @@ -26,19 +26,27 @@ predetermined, as their name needs to be saved into a variable (or put inside a list or other data-containing value) already in order for them to be usable. # Specification -When the `new` method of `oo::class` is called, it picks a new unused name -currently. This behaviour shall be extended so that when the final reference -from Tcl code to that name is lost (which shall be determined through -mechanisms such as reference counting) the object will be deleted. +When the **new** method of **oo::class** is called (and hence by default for +any class that doesn't override it), it picks a new unused name currently. +This behaviour shall be extended so that when the final reference from Tcl +code to that name is lost (which shall be determined through mechanisms such +as reference counting) the object will be deleted. Each use of `self object` (or its common alias `self`) within the object shall create another reference to the object. Looking it up through mechanisms such as `info class instances` shall create another reference to the object (while it exists). + +Renaming a garbage-collectable object (to any name) stops it from being +garbage collected, just as if it had been manufactured with **create**. +Objects with explicit names (which includes all classes themselves under +normal circumstances) are assumed to be not garbage collected, as the names +could be used in source code directly, without having been obtained from a +creation method. Instances may also be explicitly deleted through all existing mechanisms. After that, those existing references will be treated as if they were plain strings.