Check-in [a023e48805]

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:A few more notes on exporting, and lengthen some very short paragraphs by combining them.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a023e48805c0279ea10288ae2211bcb26337f285d8eeed2ebdfc3d711ec645ef
User & Date: dkf 2018-05-27 10:43:06
Context
2018-05-27
10:50
Fix markdown formatting issue check-in: 230d2e87e1 user: dkf tags: trunk, minor change
10:43
A few more notes on exporting, and lengthen some very short paragraphs by combining them. check-in: a023e48805 user: dkf tags: trunk
10:35
Add some titles to the examples check-in: 8b7522e1b5 user: dkf tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tip/500.md.

    97     97   in the same hash tables) so that there are no ambiguities.
    98     98   
    99     99   Since every method has at most one declaring class or object (and not both
   100    100   simultaneously) there is at most one private method that can be on any call
   101    101   chain. External calls (e.g., from the top level of Tcl, from a **namespace
   102    102   eval**, from a procedure) will never have a private method on thir call
   103    103   chains.
   104         -
   105    104   Once the call chain is created, the execution is handled as prior to this TIP;
   106    105   the implementation of the first element on the call chain is executed,
   107    106   whatever that is, and that can dispatch to later items on the call chain using
   108    107   **next** and **nextto**.
   109    108   
   110    109   A private method on a class (or object) may not have the same name as another
   111    110   method on that class; all methods of a class (or object) are part of a single
   112    111   space of names. When resolving a method call of a subclass of the class that
   113    112   has the private method, even if the method names match, the private method
   114    113   does not participate in the call chain; only an exact match from exactly the
   115    114   right context counts.
          115  +Applying **export** or **unexport** to a private method will make that method
          116  +cease to be private, but it must be used on the same context (class or
          117  +instance) that defined the method; subclasses or instances cannot export or
          118  +unexport a private method defined by their superclass/class (respectively).
          119  +There is no mechanism for making an existing method private; that needs to be
          120  +done at method creation time.
   116    121   
   117    122   In particular:
   118    123   
   119    124       oo::class create Top {
   120    125           method Foo {} {
   121    126               puts "This is Top::Foo for [self]"
   122    127           }
................................................................................
   289    294           }
   290    295       }
   291    296   
   292    297   That is, the **private** declaration command described above (for methods)
   293    298   also impacts the **variables** slot declaration in **oo::define** and
   294    299   **oo::objdefine**, causing it to introduce this more complex mapping
   295    300   pattern. Note that the variable resolver already is class-scoped.
   296         -
   297    301   In the above example, a subclass of _Foo_ that refers to variables _x_ and _y_
   298    302   will not see the variables defined by _Foo_, but will instead see either the
   299    303   current standard variable scheme or their own _x_ and _y_. (If the creation ID
   300    304   of _Foo_ is `123`, then _Foo_'s _x_ and _y_ will really be called `123 : x`
   301    305   and `123 : y`, respectively.)
   302    306   
   303    307   Introspection is via adding an extra option to **info class variables** and
   304    308   **info object variables**, **-private**, which causes these commands to list
   305    309   the private variables. Without the option, the non-private (i.e., direct
   306    310   mapped) variables are listed.
   307         -
   308    311   A supporting introspector is also added, **info object creationid**, which
   309    312   returns the creation ID of any existing object. It also applies to classes.
   310    313   Again, note that creation IDs are _always_ system-allocated and are _never_
   311    314   guaranteed to be unique between interpreters, either in multiple processes or
   312    315   in the same thread or process; they are only ever locally unique.
   313    316   
   314    317   # Examples