Syntax sugar idea for loops

That'll work, too. :slight_smile:

Dan

路路路

-----Original Message-----
From: Eric Hodel [mailto:drbrain@segment7.net]
Sent: Wednesday, March 30, 2005 12:38 PM
To: ruby-talk ML
Subject: Re: Syntax sugar idea for loops

people.each_with_index do |person, i|
    puts "First person: #{person} if person == people.first
    row_class = i.even? ? "row1" : "row2"
    puts "Last person: #{person} if person == people.last
end

How about that?

Hi,

> From: Eric Hodel [mailto:drbrain@segment7.net]
>
> row_class = i.even? ? "row1" : "row2"
>
> How about that?

That'll work, too. :slight_smile:

No, it won't. Therefore I proposed my even/odd patch at

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/4512

Your answer 4513 seems not to be accessible at the archive.
I remember you preferred the Ruby solution rather than the C
issue.

I still hope this feature once will be applied.

Bertram

路路路

Am Donnerstag, 31. M盲r 2005, 04:41:43 +0900 schrieb Berger, Daniel:

> -----Original Message-----

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de