auto classes and finalizers
Bruno Medeiros
brunodomedeirosATgmail at SPAM.com
Thu Apr 13 10:06:16 PDT 2006
Don Clugston wrote:
> kris wrote:
>> Mike Capp wrote:
>>> In article <e1cq0t$1fm5$1 at digitaldaemon.com>, kris says...
>>>
>>>> I thought the idea was that classes with dtors are /intended/ to be
>>>> explicitly cleaned up? That, implicit cleanup of resources (manana,
>>>> some time) was actually a negative aspect? At least, that's what
>>>> Mike was suggesting, and it seemed like a really good idea.
>>>
>>>
>>> Um... can we avoid using "implicit" and "explicit" in this context?
>>> "Implicit"
>>> to me means "without writing any code", which covers both RAII and GC
>>> cleanup
>>> (if you're lucky). "Explicit" to me means manual calls to dtors or
>>> dispose(),
>>> which is the worst of all possible approaches.
>>
>> Yeah, I see the murk. What would you prefer to call them? The
>> distinction being made there was whether the dtor was initiated via
>> delete/auto, versus normal collection by the GC (where the latter was
>> referred to as implicit).
>
> deterministic and non-deterministic.
I don't like those terms. Although they are not false (because
*currently* explicit destruction is deterministic, and implicit
destruction in non-deterministic), the fact of whether the destructor
was called deterministically or non-deterministically is not in itself
relevant to this issue. What is relevant is the state of the object to
be destroyed (in defined or undefined state).
Nor is implicit destruction/collection inherently non-deterministic and
vice-versa. (even if systems that operated this way would be unpractical)
So far, I'm keeping the terms "implicit" and "explicit", as they seems
adequate to me and I don't find at all that RAII collection is
"implicit" or "without writing any code".
--
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list