From: "Hal E. Fulton" Date: 2003-03-02T05:57:12+09:00 Subject: Re: Coding challenge: Space-separated constants ----- Original Message ----- From: "Sabby and Tabby" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Saturday, March 01, 2003 10:07 AM Subject: Re: Coding challenge: Space-separated constants > Simplified scan, moved error check outside loop, added eval binding > context, and wrote a haiku. [snip code] Worthy changes, thanks very much! My favorite part is the haiku. ;) > a = "I n c r e m e n t a l" > > a = < 111 proc do |x| x.to_i.chr end <<-1 > 82 > 117 Refactoring code > 98 Insert seven syllables > 121 One line at a time > 1 > 33 callcc {|x| x} print(a[0].chr,a[-2,2]) > EOF > > a.size < a[0] and a[4].call or puts "ve #{a[2].map(&a[1])}" << a[3] For those who are too lazy to run this themselves, the output is: I looooooooooooooooooooooooooooooooooooooooooooooooooooove Ruby! Thanks much for the refactoring and entertainment. The code snippet above makes my brain itch. I don't recall seeing you post before... are you a long-time lurker or have I just not been paying attention? Hal