Check-in [86042fe174]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Clarify a few things.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 86042fe174d932474bed920898089232f8df6b5d6cea34040e8397ff262db53f
User & Date: dkf 2019-06-11 19:03:16
Context
2019-06-12
02:05
Clean up some awkward language; thanks to AK for spotting. check-in: 92a144c351 user: dkf tags: trunk
2019-06-11
19:03
Clarify a few things. check-in: 86042fe174 user: dkf tags: trunk
18:48
New TIP. check-in: b468ad2d36 user: dkf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/550.md.

24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39







40
41
42
43
44
45
46
47
48
49
50
51
instead to deleting objects once they are no longer referenced by the rest of
the program; this is a reasonable fit for objects whose name is not
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.

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).








Instances may also be explicitly deleted through all existing mechanisms.
After that, those existing references will be treated as if they were plain
strings.

# Implementation

To be done.

# Copyright

This document is placed in public domain.






>
|
|
|
|





>
>
>
>
>
>
>












24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
instead to deleting objects once they are no longer referenced by the rest of
the program; this is a reasonable fit for objects whose name is not
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 (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.

# Implementation

To be done.

# Copyright

This document is placed in public domain.