From: Daniel Nugent Date: 2006-02-08T03:57:45+09:00 Subject: Re: reasons to use else inside rescue I think that sort of control structure would see a lot of use when you're programming in a situation where asynchronous exceptions might be expected. In a case like that, you might be going a long, catch an exception, look at it, and then conditionally, have to run off and do something else immediately, change how you're handling what you were currently doing, or maybe just try again. And in each of those cases, you might have specific sorts of cleanup code that you need to execute. With synchronous exceptions, it's a little less useful since you pretty much know that just giving it another shot will not help you get the job done. On 2/7/06, Logan Capaldo wrote: > > On Feb 7, 2006, at 7:10 AM, Mark Volkmann wrote: > > > > Thanks! All this makes sense now. > > > > Even though there is some value to it, I suspect that "else" inside a > > "begin" is rarely used. By "rarely", I mean less that once per hundred > > "begin" blocks. I suspect this is because it's not a well known > > feature and ends up making the code a bit harder to understand. I > > think I'd typically tend to put the "else" code inside the "begin" > > block. Does anyone disagree with this? > > > > -- > > R. Mark Volkmann > > Partner, Object Computing, Inc. > > > I feel like this is one of those features that I'll need to use maybe > twice. It'll just lurk there in the back of my head until I come > across a problem where using that 'else' is exactly what I'll need, > and then I'll be grateful its there. I don't think it hurts anything > by existing. > > -- -Dan Nugent