aboutsummaryrefslogtreecommitdiff
path: root/oo.tcl
AgeCommit message (Collapse)AuthorFilesLines
2023-01-06oo.tcl: fix error in defaultconstructorSteve Bennett1-2/+3
$classname is not accessible, so use [info level 0] Fixes #248 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20oo: better object constructionSteve Bennett1-6/+13
Now a default constructor is created, as an alias for defaultconstrutor. The constructor is passed the arguments to new and by default this accepts a dictionary that is checked for valid instance variables and sets them. However the constructor can be replaced by one that takes arbitrary arguments. Thus we can how have: a new -optiona -optionb And the constructor is invoked with arguments '-optiona -optionab'. This makes object initialisation more flexible. ** Note: This is an incompatible change if you have classes with a constructor and you create object instances with new <dict>. Signed-off-by: Steve Bennett <steveb@workware.net.au> Documentation fixes - Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2021-02-20oo: minor code cleanupsSteve Bennett1-5/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-20oo: instance ref should be fully qualifiedSteve Bennett1-2/+1
In case the class is created with a namespace name Fixes #193 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-10-04oo: fix super for >2 levels of inheritanceSteve Bennett1-2/+3
Need to find the baseclass based on the current method class, not based on the object class. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-23oo: Fix super invocationSteve Bennett1-1/+1
An implicit concat was being done on the arguments to 'super', so arguments containing spaces were mangled. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-02-06Fix #148 - oo errors with no class variables.TheMarkitecht1-1/+1
https://github.com/msteveb/jimtcl/issues/148
2018-06-30oo: Fix 'methods' for superclassesSteve Bennett1-1/+1
Methods inherited from a base class are created with alias, so they are not returned by 'info procs'. Need to use 'info commands' instead.
2016-03-27oo: constructor, unknown and bug fixesSteve Bennett1-9/+17
- 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>
2011-12-16oo: aliases are now commands, not procsSteve Bennett1-2/+2
So fix oo.tcl when falling back to base class methods Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-26Class vars should take precedenceSteve Bennett1-2/+4
...over baseclass vars. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-07Minor improvements to oo.tclSteve Bennett1-1/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-16Add a pure-TCl OO implementation to JimSteve Bennett1-0/+89
And document the OO extension in README.oo Signed-off-by: Steve Bennett <steveb@workware.net.au>