From: Logan Capaldo Date: 2006-04-25T01:42:26+09:00 Subject: Re: How to make an array from a date range? On Apr 23, 2006, at 1:11 PM, Robin Stocker wrote: > ara.t.howard@noaa.gov wrote: >> if you do simply use >> list = (a .. b).inject([]){|accum, date| accum << date} > > I'm curious, is there a special reason for the use of inject here? > Doesn't the following do the same? > > list = (a..b).to_a > >> -a > > Robin > Yes, they are exactly the same. It's just that inject is a force of nature. It consumes your Enumerables, and leaves a trail of devastation in its wake. You can't escape it. You must accept your fate as a slave to inject.