Hi,

In message "[ruby-talk:26285] Re: [OT] Re: KDE or GNOME curiosity question..."
    on 01/11/24, Edward Diener <eldiener / earthlink.net> writes:

|> Ruby and many other languages with GC (Java is in the same boat) allow
|> resource finalization when the object is "destroyed".
|
|I am aware of that but unfortunately, like Java, one can't force the 
|object to be "destroyed" a well-ordered point.

I don't get the point.  First of all, what does RAAI stand for?

Second, are you claiming either following (a) or (b)?

 (a) resource finalization must occur when the object is recycled.

 (b) object reclamation must occur when the last reference to it is
     removed.

Ruby ensures (a), not (b).  It's kinda hard to tell when the
reclamation happens.  But I believe if you want to finalize
resource/object at certain point, you'd better to finalize it
explicitly.  If you don't care when, leave it to the garbage
collector.

Plus, for explicit resource management, in Ruby, you can use the idiom
like

  open(path) do |f|
    ...
  end

that ensures f to be closed at the end of the block.

							matz.