Re: [TCLCORE] Pre-CFV: TIP#257
by Donal K. Fellows other posts by this author
May 6 2008 3:11PM messages near this date
Re: [TCLCORE] Pre-CFV: TIP#257
|
Re: [TCLCORE] Pre-CFV: TIP#257
Daniel A. Steffen wrote:
> one difference between TclOO and XOTcl that I've run into is the
> semantics of class destruction (c.f. script below).
[...]
> I have no opinion on which of those behaviours is better, indeed I
> can see uses for both, so I am wondering if you have thought about
> making class destruction configurable/pluggable in TclOO?
Destructors are run before the object command actually gets deleted; I
just checked! Since this is deep inside the complex mess that is traces,
I couldn't tell from what I remembered of the code. Thus, if a class
destructor (well, metaclass destructor I suppose) detaches the
subclasses and instances, they'll survive. That is to say, you can
change the current behaviour entirely through writing Tcl code. I hope
that does the trick for you. :-)
Evidentiary log:
% package req TclOO
0.2
% oo::class create foo {
destructor {puts [self];[self] spong}
method spong {} {puts SPONG!}
}
::foo
% foo create bar
::bar
% bar spong
SPONG!
% bar destroy
::bar
SPONG!
Donal.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Twylite
Will Duquette
Kevin Kenny
Kevin Kenny
Will Duquette
Arnulf Wiedemann
Will Duquette
Kevin Kenny
Donal K. Fellows
Twylite
Larry W. Virden
Twylite
Gustaf Neumann
Larry McVoy
Gerald W. Lester
Vasiljevic Zoran
Larry McVoy
Gerald W. Lester
Larry McVoy
Tomasz Kosiak
Gustaf Neumann
Donal K. Fellows
Daniel A. Steffen
Donal K. Fellows
Daniel A. Steffen
Donal K. Fellows
Donal K. Fellows
Daniel A. Steffen
Gerald W. Lester
Vasiljevic Zoran
Arnulf Wiedemann
Tom Krehbiel
Vasiljevic Zoran
Donal K. Fellows
Gustaf Neumann
Brian Griffin
Gustaf Neumann
Donal K. Fellows
Gustaf Neumann
Kristoffer Lawson
Daniel A. Steffen
Twylite
Donal K. Fellows
Will Duquette
Donal K. Fellows
Will Duquette
Arnulf Wiedemann
dgp
Donal K. Fellows
Arnulf Wiedemann
Twylite
Will Duquette
Twylite
Donal K. Fellows
Stefan Sobernig
Donal K. Fellows
Stefan Sobernig
|