From: "meinrad.recheis" Date: 2003-08-08T06:06:59+09:00 Subject: Re: Elegant solution for a loop-break problem Ok, i see. you could end up rescueing exceptions that should not be cought, for they were not raised to escape the loops. sorry, mr On Fri, 8 Aug 2003 04:29:48 +0900, Hal E. Fulton wrote: > ----- Original Message ----- > From: "meinrad.recheis" > Newsgroups: comp.lang.ruby > To: "ruby-talk ML" > Sent: Thursday, August 07, 2003 1:46 PM > Subject: Re: Elegant solution for a loop-break problem > > >> why not? (i dont understand your indignation) because something is > intended >> for something special, it does not mean that it isnt good for something >> else. >> however, in java it is the only way to escape a nested loop. > > I don't think he's indignant. Nor am I. But I think > exceptions are not the best way to do this in Ruby. > > I think in Ruby you should use throw/catch instead > of raising an exception... I perceive these to be > for exactly such boundary situations. > > Hal > >> -mr >> >> On Thu, 7 Aug 2003 16:54:48 +0200, Robert Klemme >> wrote: >> >> > >> > "meinrad.recheis" schrieb im Newsbeitrag >> > news:oprtjhkqv9edtuaz@news.tuwien.ac.at... >> >> raising an Exception is an excellent way of escaping nested loops. >> > >> > Err, are you serious? IMHO exceptions are for exceptional conditions > and >> > not for control flow. >> > >> > robert >> > >> > >> >> >> > > > -- - mr