On 2010-08-10 08:11:21 -0400, "Steven Schveighoffer" <[email protected]> said:

Undefined, undefined, undefined :)

So we agree on that. That's exactly what I was trying to prove to Andrei. Using clear() can break program invariants, break the type system (immutable members) and so on, even though I admit it can be useful at times.

**** So why give it a so innocuous-looking name such as "clear" !! ****

Call it destroy() at the very very least, and put it in a module where no one will find it by accident and think it is safe for general use. For instance, it could be made part of the GC API, allowing the GC to adjust the memory block to avoid calling the destructor a second time upon collection. GC.destroy() sounds like a good name for that kind functionality.

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to