OO in the core is already here. It is included in the Tcl 8.6 betas
and you can use it with 8.5 with an external extension.
/Ashok
The core's OO isn't stooop (remember, there are three 'o's in it) but
rather has more in common with [incr Tcl] and XOTcl. As stooop is
purely scripted, it will continue to be supported (by the tcllib
maintainers) but it's not the focus of any development that I'm aware
of. It's also much slower than core OO (or itcl or xotcl) when using
virtual methods; with the core OO system, virtual methods with a
complex inheritance hierarchy are almost as fast as direct procedure
calls. Which is neat.
So in short, use stooop if you want but it's not an area that is going
to get a lot of work from the rest of us. (And as APN mentions, you
can try out the core OO today by getting the TclOO package and loading
it into a Tcl 8.5 interpreter, or trying out the beta of 8.6.
ActiveTcl is a good way to do either.)
Donal.
If you make use of Tcl 8.6, you can actually do work in either the
minimalistic TclOO, or the now included incr Tcl.
Perhaps someone will eventually take a look at stooop and see if it
would benefit from being updated to make use of Tcl 8.6 features to
speed it up. I don't know of anyone considering that at this time,
however.
Use the best tool for the job.
If you get on with stooop and performance is not an issue then carry
on using it.
I think I read somewhere that the intention behind the new built in OO
implementation is not so much to replace all the other OO
implementations but to allow them all to be implemented as a thin
script layer on top of an efficient common C core thus reducing
migration and maintenance problems and, for those OO extensions
currently implemented only as scripts, to improve performance.
In particular, if you are looking to build mega widgets there is no
way that you want to be using the built in OO directly as all other
options save you a lot of effort.
IMHO snit is the easiest to use for many (but not all uses).
As others have mentioned the core OOP is meant to be built on top of. [Incr
Tcl] is haveing a release that builds on top of it. I think SNIT is going
to be updated to take advantage of it. I'm not sure of STOOP.
You may want to ask the STOOP author (jfon...@free.fr) if he has any
intentions of updating it to take advantage of the core OOP.
--
+------------------------------------------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
I did not notice SNIT when I looked at Tcllib for OOP packages. Also,
I was under the impression [incr tcl] was not being maintained and had
not been touched in 10 years. It sounds as if it is being maintained,
and might be worth pursuing.
Check out the new core package on the web.
> I did not notice SNIT when I looked at Tcllib for OOP packages. Also,
> I was under the impression [incr tcl] was not being maintained and had
> not been touched in 10 years. It sounds as if it is being maintained,
> and might be worth pursuing.
Depends on what *kind* of OOP you want to do.
[incr tcl] is very C++ like.
Snit, to me, feels more Tclish -- a lot more flexable than [incr tcl].
Don't remember STOOP enough to talk about it.
You may want to look at http://wiki.tcl.tk/10771 and other pages on the wiki
or the net.
Why migrate?
Stooop will probably continue to work perfectly well pretty much
indefinitely if that is what you want to use. That is because it is (I
believe) pure Tcl.
It might be that future releases bend the syntax or semantics to
enable it to more easily fit on top of core OO. Your way to protect
yourself from this is to make sure that you "package require stooop
4". If anyone makes a breaking change for core oo then they should
change the major version. Multiple versions can coexist.