From: "Dmitry V. Sabanin" Date: 2004-06-01T02:32:42+09:00 Subject: Re: elegant way to say "try this thing, one at a time, until condition is met" On Monday 31 May 2004 20:08, Robert Klemme wrote: > "Dmitry V. Sabanin" schrieb im Newsbeitrag .... > > # emulating condition > > $counter = 0 > > def cond_met > > $counter += 1 > > $counter > 1 ? true : false > > end > > Just a sidenote: you don't have to convert the result of a boolean > expression to boolean by means of the ternary operator. This will do > exactly the same: > > def cond_met > ( $counter += 1 ) > 1 > end Damn C background.. I always forget about this thing. Thanks, Robert > Regards > > robert -- sdmitry -=- Dmitry V. Sabanin MuraveyLabs. Spam Here -> postmaster@sco.com