From: Dirk Detering Date: 2002-07-09T19:39:40+09:00 Subject: Re: for ... else ... end ts schrieb: > What do you call a `for' loop ? Generally: An iterative loop. (iterative means: every entry starts with a new parameter. Maybe the next list item, or an incremented value or something like that). > For me > for i in 1..2 > end > is the same than > (1..2).each do |i| > end > except for block local variables. Aha!! ;-) Well that may be the current state. But what about thinking of a for loop as a syntactic sugar of a catch/throw construct? The topic we discuss here is based on the feeling, that some more complex flow control should be easily expressable by language support. What possibilities does Ruby currently have to express the following scheme completely? (parts of it have just been shown in this thread): iterate over elements in container if no elements were found do ... if loop completes without break do ... if loop has been interrupted with break do ... Can all this *easily* be expressed via catch/throw ? Bye Det