[gclist] Requirments for finalizers.
Fri, 11 Jul 1997 09:31:34 -0500
I've come to reject my finalizer order number
scheme for several reasons and have something
that can be checked at compile time and seems
First some objects such as file objects have
finalizers which reduce their usefulness they
might even be said to destroy the objects
invariants. Let us call them destructor objects.
All destructor objects will have their finalizers
run in an undefined order after all finalizer
objects have their finalizers run in an undefined
order. So we need only verify that no destructor
object uses another destructor object. The nature
of destructor objects makes this an acceptable
Objects which refer to destructor objects may
become less useful after destructors start
being run so we refer to them as destructor
reference objects. Any object which refers
to a destructor reference object becomes a
destructor reference object.
Since destructor objects and destructor reference
objects are less general than ordinary objects,
they can't be safely used after destructors start
being run, they cannot subclass non destructor and
destructor reference objects.
Last a destructor reference object can't
simultaneously be a destructor object. All this
can be checked by the type system and it all
fits into meta object protocols like those in
CLOS so it can be experimented with short of
writing a new compiler.
Charles Fiterman Geodesic Systems
414 North Orleans Suite 410 Phone 312 832 1221 x223
Chicago IL 60610-4418 FAX 312 832 1230
A young man saw a product advertised in a magazine that said
"Guaranteed 100% effective against bugs when properly used."
He sent away and got two blocks of wood with the instructions
"Place bug on block A, strike sharply with block B." Debuggers
are like that, and you can get stung while using them. Great
Circle tries to be something better than that.