From Newsgroup: comp.lang.tcl
Olivier <
user1108@newsgrouper.org.invalid> wrote:
Mark Summerfield <m.n.summerfield@gmail.com> posted:
There are quite a few commands provided in Tcllib that create _global_ commands.
Here are just 3 examples (there are others):
::struct::disjointset disjointsetName
Creates a new disjoint set object with an associated global Tcl command
::struct::graph ?graphName? ?=|:=|as|deserialize source?
The command creates a new graph object with an associated global Tcl command >>
::struct::tree ?treeName? ?=|:=|as|deserialize source?
The command creates a new tree object with an associated global Tcl command >>
Given that TclOO is a standard part of Tcl and that since Tcl 9 offers
very comprehensive OO support, ought the Tcllib commands that create global >> Tcl command be deprecated in favour of new commands (to be added) which
create actual objects?
Isn't it a false good idea to name those "object" when they are in fact "namespace" ?
Also some of them are nicely imbricated for example : matrix, report, csv. You will
need a huge workforce to achieve this, unless you use AI, a lot of money
and manage licenses of different authors.
You will probably have to create a fork of Tcllib with only a few modules as a start.
Olivier.
The namespace ensembles created by these commands act like (and have
some of the qualities of) objects. They call their internal procedures
via "method names" (while not actually calling them 'methods') and they provide a "package of isolated [1] data (namespace variables) and methods
(the procedures) to operate on that data".
They very much fit the "if it walks like a duck, and it quacks like a
duck, then it might very well be a duck" mindset. So calling them
'objects' is not too far from reality.
[1] as isolated as anything can be in Tcl given its strong
introspection abilities.
--- Synchronet 3.22a-Linux NewsLink 1.2