From: Art Taylor Date: 2003-01-16T08:18:28+09:00 Subject: Re: Ruby advocacy in sigs ------=_Part_1_1737542.1042672705218 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I don't know if sending buggy code is the best way to proselytise the language, readable or not. :-) -a. > -----Original Message----- > From: Daniel Carrera > Sent: Wed Jan 15 17:39:42 EST 2003 > To: [ruby-talk ML ] > Cc: [] > > > On Thu, 16 Jan 2003, Gennady wrote: > > > > > > > my favourite: > > > 99.downto 1 do |x| > > > puts "#{x} bottles of beer on the wall", > > > " #{x} bottles of beer!", > > > "Take one down, pass it around," end > > > > > > puts "No more bottles of beer on the wall!" > > > > > > > A small refactoring ;-) -- > > > > 99.downto 1 do |x| > > puts "#{x} #{@b||='bottles of beer'} #{@w||='on the wall'}", > > " #{x} #{@b}!", > > "Take one down, pass it around," end > > puts "No more #{@b} #{@w}!" > > > > Well, the idea is that any reader can understand the code, thus > demonstrating the readability of Ruby. I can't figure out what your code > does, so I doubt a non-rubyist would. > > How about?: > > 99.downto 1 do |x| > puts < #{x} bottles of beer on the wall. > #{x} bottles of beer. > Take one down, pass it around. > EOH > end > > Daniel Carrera > Graduate Teaching Assistant. Math Dept. > University of Maryland. (301) 405-5137 > > > ------=_Part_1_1737542.1042672705218--