diff options
author | Steve Bennett <steveb@workware.net.au> | 2016-03-24 20:50:23 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-03-27 11:01:48 +1000 |
commit | 45c9e90f3956ae5b8e561be046153bcb6ffc0985 (patch) | |
tree | 05994e1aed852670a235fd7bce0d22c5d81ef235 /README.oo | |
parent | bd25a29a3766bcf9327c8c8d032d0bb773ca4e6a (diff) | |
download | jimtcl-45c9e90f3956ae5b8e561be046153bcb6ffc0985.zip jimtcl-45c9e90f3956ae5b8e561be046153bcb6ffc0985.tar.gz jimtcl-45c9e90f3956ae5b8e561be046153bcb6ffc0985.tar.bz2 |
oo: constructor, unknown and bug fixes
- Added support for constructor, runs on new object creation
- Added support for "unknown" method
- Rename some dispatch variables (add double underscore) to avoid collision with user variables
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'README.oo')
-rw-r--r-- | README.oo | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -100,6 +100,18 @@ on a specific object. the instance variables, and evaluate the body in that context. This can be used for one-off evaluation to avoid declaring a method. +RESERVED METHODS +---------------- +The following methods are special + + constructor:: + If this method exists, it is invoked (with no arguments) after an object is created + + unknown methodname ...:: + If an undefined method is invoked, and this method exists, it is called with the methodname + and the original arguments + + CREATING OBJECTS ---------------- An object is created with the 'new' method, or simply by using the classname shortcut. @@ -120,6 +132,8 @@ For example: . $b get balance 1000 +If the 'constructor' method exists, it is invoked just after the object is created + DECLARING METHODS ----------------- In addition to the predefined methods, new methods may be declared, or existing |