From: dblack@... Date: 2006-08-14T08:09:30+09:00 Subject: Re: Newbie at ruby - syntactic sugar for Range / Array Hi -- On Mon, 14 Aug 2006, Rick DeNatale wrote: > On 8/12/06, Rick DeNatale wrote: >> On 8/12/06, dblack@wobblini.net wrote: >> >> > >> > So the only weird thing is that ranges can turn themselves into arrays >> >> Nothing at all wierd about that, any enumerable can, which makes >> perfect sense when you think about it. > > And an afterthought. > > They don't get turned into anything. The message to_a returns an an > array which represents the receiver, unless the receiver happens to be > an array, in which case it simply returns itself. Let me rephrase my point: the only weird thing is that ranges are enumerable :-) David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.