Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Got the description of classvariable wrong. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e3243a61075671db983eda8527187850 |
User & Date: | dkf 2018-06-17 16:52:54.706 |
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
Changes to tip/478.md.
︙ | ︙ | |||
37 38 39 40 41 42 43 | 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. | < < < < < < > > > | 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 |
︙ | ︙ |