From: Justin Johnson Date: 2002-07-09T18:06:06+09:00 Subject: Re: for ... else ... end At first, I didn't think this kind of construct would be that useful, but after some thought I can see that it might be a good addition. I can see it being used in 'for' loop searching situations where 'break' is used when some search criteria is met, found a string in a list for example. Normally you'd achieve this with a boolean variable called something like 'found'. How about 'default' ? for i in (0..9) if (i == 5) break end default p "finished" end while i < 10 if ( i == 5 ) break end i += 1 default p "finished" end It seems to make sense to use the same keyword that is used to provide default behaviour for case constructs. However, Rubys equivilent of 'default' clause for the case construct is actually the 'else' keyword! The 'when' statements in a case construct are automatically doing a 'break' if the condition is true. If none of the conditions are met ( a 'break' is not done ), the 'else' clause executes. Logically, this is the same behaviour that were looking for to extend loops. Using 'else' would at least be consistent. -- Justin Johnson