From: James Edward Gray II Date: 2006-02-22T00:16:00+09:00 Subject: Re: Blocks / Closures On Feb 21, 2006, at 9:08 AM, Picklegnome wrote: > I've just been looking into Ruby in the last few days, and I must > say it > does look promising. However, many of the tutorials and other > resources I've > been looking at use blocks. Having done some research, I'm > beginning to > understand what they are and how they are used. However, I've only > come > across examples that use them for iteration and keeping a static > variable > hidden. Is there something I'm missing? Can blocks be used for non- > iterative > functions? Sure. File::open uses a block for resource clean-up (auto file closing). The standard PStore library uses them for transactions. Hope that helps. James Edward Gray II