From: Gennady Date: 2003-01-16T08:35:04+09:00 Subject: Re: Ruby advocacy in sigs ----- 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. :-) What do you mean? It runs perfectly well for me, I copied-and-pasted it right from your reply (removing leading "> >'). Have you tried it or it just seems buggy to you? If you ran it though and it failed, what version of ruby have you used? Platform? It all started as a joke, however if you are right it could teach me something at the end. Just help me see it. Thank you, Gennady. > > -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 > > > > > > >