Check-in [e3243a6107]

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

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

Overview
Comment:Got the description of classvariable wrong.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:e3243a61075671db983eda852718785091ea20872deba33b0c005c372cbaa9c9
User & Date: dkf 2018-06-17 16:52:54
Context
2018-06-20
12:20
Added TIP 511 for Christian Werner, who is having problems with his fossil login check-in: 063fc0cf1c user: dkf tags: trunk
2018-06-17
16:52
Got the description of classvariable wrong. check-in: e3243a6107 user: dkf tags: trunk
2018-06-15
09:02
fixed code error check-in: 51aba99441 user: rene tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/478.md.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60



61
62
63
64
65
66
67
subclasses can be instantiated.

## New Definitions

The `classmethod` class definition creates a method that can be used when
invoked against its defining class or any of its subclasses.

The `classvariable` class definition creates a variable that exists in a
class's namespace and which is linked into any instance of that class
(including instances of subclasses); setting the variable with that name from
any of those instances or from the class will result in changes that can be
observed from all instances of that class.

The `initialise` class definition evaluates a script in a context where it can
access the class's namespace, allowing for easier initialisation of a class
than simply overriding its constructor.

## New Helper Commands

The `callback`/`mymethod` command, available within methods, takes the name of
a method and zero-or-more arguments and returns a script fragment that will
allow that method easy to invoke from a callback (e.g., a variable `trace`,
`chan event` callback, or Tk event binding). The command will be available
with both names.




The `link` command, available within methods, creates a binding for methods
so that calling the command with the given name is equivalent to calling
`my $name` instead. It can link multiple methods with one call, one per
argument, and those created commands can be renamed without losing the link;
if an argument is a two-element list, the first element is the name of the
method and the second is the name of the command (which will be resolved







<
<
<
<
<
<











>
>
>







37
38
39
40
41
42
43






44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
subclasses can be instantiated.

## New Definitions

The `classmethod` class definition creates a method that can be used when
invoked against its defining class or any of its subclasses.







The `initialise` class definition evaluates a script in a context where it can
access the class's namespace, allowing for easier initialisation of a class
than simply overriding its constructor.

## New Helper Commands

The `callback`/`mymethod` command, available within methods, takes the name of
a method and zero-or-more arguments and returns a script fragment that will
allow that method easy to invoke from a callback (e.g., a variable `trace`,
`chan event` callback, or Tk event binding). The command will be available
with both names.

The `classvariable` command, available within methods, binds a local variable
to a variable within the namespace of the class that defined the method.

The `link` command, available within methods, creates a binding for methods
so that calling the command with the given name is equivalent to calling
`my $name` instead. It can link multiple methods with one call, one per
argument, and those created commands can be renamed without losing the link;
if an argument is a two-element list, the first element is the name of the
method and the second is the name of the command (which will be resolved