On Thu, 31 Mar 2005 16:54:25 +0900, Lasse Koskela
<lasse.koskela / gmail.com> wrote:
> On Thu, 31 Mar 2005 16:34:44 +0900, Robert Klemme <bob.news / gmx.net> wrote:
> > Yeah, "odd" and "even" are much too specific IMHO.  Using the index is the
> > most general solution.
> 
> True, odd and even are rather specific but is that such a bad thing,
> really? If the odd-even semantics are a common need, why not add
> support for it in the language? I mean, why else would Ruby have
> Array.each etc. instead of for (i=0; i < x; i++) which is clearly more
> powerful in terms of all the things you can do with it?

Internal and external iterators are equivalent given the existance
of continuations. It may be interesting to explore the possibilities
of representing flow control as an object. To start the debate...

for () {
 case for.special # Cant think of a better name right now :(
 when for.first
  ..
 when for.last
  ..
  for.restart if error
 else
   ...
   for.next
   puts "We get here, unlike the real next keyword"
 end
}

Please note, I am -not- suggesting these for Ruby. I dont even like the
odd/even idea personally. Im brainstorming to see what is possible and
would like to see what others can come up with as well.

-- 
spooq