Edward Diener wrote:

> Having designed classes and frameworks in C++, I find Java, Python,
> and Ruby's non-support for the ordered destruction of objects somewhat
> irritating to the way I design and program. I don't like the kludges
> and workarounds to this general problem and strongly feel that a good
> language, and I include Ruby as a good language, should have a natural
> solution to this problem as part of the syntax of the language rather
> than just ignoring it as an issue.

IMHO, you're trying to apply RIAA in languages where it does not apply. 
That idiom is very fine in C++, it doesn't work in GC'ed languages. The 
solution is to use appropriate constructs such as

    File.open("file") do |f|
        ...
    end

AFAICT, this is morally equivalent to the age-old "with-" macros used 
in Lisp. The idea is to keep object lifetime and "block-bracketing" 
separate. Also, this way deals better with the case, where the 
block-end operation might throw an exception. With RIAA, at least in 
C++, you run into the problem that in practice you're never safe to 
throw from a destructor.

Michael

-- 
Michael Schuerig                   GPG Fingerprint
mailto:schuerig / acm.org            DA28 7DEB 5856 3365 BED9
http://www.schuerig.de/michael/    8365 0A30 545A 82D2 05D7