From: Martin DeMello Date: 2003-01-23T06:41:34+09:00 Subject: Re: Ruby idiom (0...(expr)).map Gavin Sinclair wrote: > Well, you always have "occasion" to define the "expr" in (0...expr). > If it's inline and messy, you create an expression variable. Yeah, but that has an unnecessary feel to it. > I can't see that particular idiom disappearing in a hurry. Have you > tried the shortcut yourself, with pleasant results? > > class Fixnum > def map(&block) > (0...self).map &block > end > end Nope - since the main purpose was to make my code read better, I decided to adopt matz's philosohpy and wait until I've found the perfect name for it. Fixnum#map doesn't sound right, IMO. martin