From: Brian Adkins Date: 2007-10-31T23:55:02+09:00 Subject: Re: Why, oh, why, little regexp? On Oct 31, 7:17 am, "Rick DeNatale" wrote: > On 10/31/07, Brian Adkins wrote: > > > On Oct 30, 11:58 pm, Phrogz wrote: > > > On Oct 30, 9:30 pm, Daniel Waite wrote: > > > > > That's clever use of ?a, which I recognize but have never seen anyone > > > > use before. Thanks for the example! > > > > My current favorite use for the ?x syntax is converting single- > > > character strings representing digits into their integer form: > > > Yeah, so you can squeeze Ruby code into small places :) > > > 1.upto(?d){|i|i%3<1&&x=:Fizz;puts i%5<1?"#{x}Buzz":x||i} > > Except under the upcoming revision (1.9) of the (Ruby) Rules of Golf, > the R(uby)&A(ncient) has outlawed that usage, and instituted the > penalty that ?d will no longer be 100, but "d". Well, then the least they can do is add Integer#to as an alias for Integer#upto so we can have a net loss of 1 character in the above code :)