Yes, Ashok's book is a treasure. It's in fact the only significant
information I've studied on TclOO.
I've also been reading his blog at
https://www.magicsplat.com/blog/tcl87-oo/
and he mentioned that there's work being done on private variables and
methods.
To academics who design programming languages with the goal of enabling
program correctness proofs (once quite the popular rage), private data
is needed to assure that some algorithm, either by design or error,
cannot have clobbered your data.
For example, in C, this is impossible since I can do such things as get
the address of a local variable and then through *p walk up the stack
frames possibly with evil intent. Many such tricks are commonly used in
exploits today.
And so with TclOO, I was wondering if that is part of the goal for
upcoming enhancements. I believe that outside of TclOO, I can pretty
much find any data (created at script level) if I know how to look. And
even an object's data can be accessed if you know the namespace it's in.
Starting with an example from Ashok's book,
oo::define Account {
variable AccountNumber Balance
}
I then discovered using these sorts of statements:
namespace eval ::oo::Obj52:: {info vars}
from a console (or using a tk widget -textvariable) I can monitor those
variables:
% set ::oo::Obj52::Balance
1000000
Anyway, I am attempting to see if my namespace debugging tools can be
applied to TclOO as well.
So, I guess a question I have is: will tcl remain tcl, where programs
will continue to be able to have access to pretty much everything if you
know where and how to look.