From: Ryan Date: 2001-11-07T07:27:31+09:00 Subject: [ruby-talk:24474] Re: Range in Hash array? > > I'd like to be able to do something like: > > {1..100=>"a",101..300=>"c", 500..1000=>"r"} Not sure if this does what you want, but it's a possibility: h=[] h.fill('a', 1..100) h.fill('c', 101..300) h.fill('r', 500..1000) which would create an array of these elements, filled per the range given. this would actually read exactly the same way, i.e. h[5] == 'a' and h[301] == nil Ryan