From: Art Taylor Date: 2003-01-17T07:59:29+09:00 Subject: Re: Ruby advocacy in sigs ------=_Part_6_18813333.1042757960138 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Actually, I was thinking more in terms of declension. (Hint: what is printed when x is 1?) -a. > -----Original Message----- > From: Gennady > Sent: Wed Jan 15 18:57:34 EST 2003 > To: [ruby-talk ML ] > Cc: [] > > > Oh, I seem to see what you meant: a leading space before EOH in Daniel's > code without '-' before 'EOH' in "< might have sneaked in while mail processing/replying/forwarding. > > Gennady. > > ----- Original Message ----- > From: "Art Taylor" > To: "ruby-talk ML" > Sent: Wednesday, January 15, 2003 3:18 PM > Subject: Re: Ruby advocacy in sigs > > > > 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_6_18813333.1042757960138--