> In Ruby, though, the object gets destroyed by garbage collection, not by > explicit destruction or stack unwinding. So RAII wouldn't work; you can > never guarantee when (or if) the resource will be closed. Instead, > resource-wrappers like File often let you specify a block; the wrapper > opens the resource, yields to the block, and closes the resource for > you. > It's just a different wrapping idiom. If you haven't discovered > http://gotapi.com already, load up the Ruby tab and check out IO#open. > > > * Wasn't RAII originally called RAIN, Resource Acquisition Is > iNitialization? I could swear it was, and it certainly seems a more > memorable choice for an acronym, but Google's not bearing me out on > this. > Then again, that was pre-Google. Anyone? Well, I'd love to be able to give advice eventually in this forum, to someone even newbier than me. It's such a generous forum that I feel I have to give back in some way. . . . -- Posted via http://www.ruby-forum.com/.