Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.
|Comment:||Got the description of classvariable wrong.|
|Downloads:||Tarball | ZIP archive | SQL archive|
|Timelines:||family | ancestors | descendants | both | trunk|
|Files:||files | file ages | folders|
|User & Date:||dkf 2018-06-17 16:52:54|
|12:20||Added TIP 511 for Christian Werner, who is having problems with his fossil login check-in: 063fc0cf1c user: dkf tags: trunk|
|16:52||Got the description of classvariable wrong. check-in: e3243a6107 user: dkf tags: trunk|
|09:02||fixed code error check-in: 51aba99441 user: rene tags: trunk|
Changes to tip/478.md.
37 37 subclasses can be instantiated. 38 38 39 39 ## New Definitions 40 40 41 41 The `classmethod` class definition creates a method that can be used when 42 42 invoked against its defining class or any of its subclasses. 43 43 44 -The `classvariable` class definition creates a variable that exists in a 45 -class's namespace and which is linked into any instance of that class 46 -(including instances of subclasses); setting the variable with that name from 47 -any of those instances or from the class will result in changes that can be 48 -observed from all instances of that class. 49 - 50 44 The `initialise` class definition evaluates a script in a context where it can 51 45 access the class's namespace, allowing for easier initialisation of a class 52 46 than simply overriding its constructor. 53 47 54 48 ## New Helper Commands 55 49 56 50 The `callback`/`mymethod` command, available within methods, takes the name of 57 51 a method and zero-or-more arguments and returns a script fragment that will 58 52 allow that method easy to invoke from a callback (e.g., a variable `trace`, 59 53 `chan event` callback, or Tk event binding). The command will be available 60 54 with both names. 55 + 56 +The `classvariable` command, available within methods, binds a local variable 57 +to a variable within the namespace of the class that defined the method. 61 58 62 59 The `link` command, available within methods, creates a binding for methods 63 60 so that calling the command with the given name is equivalent to calling 64 61 `my $name` instead. It can link multiple methods with one call, one per 65 62 argument, and those created commands can be renamed without losing the link; 66 63 if an argument is a two-element list, the first element is the name of the 67 64 method and the second is the name of the command (which will be resolved