On Oct 24, 2013, at 1:24 AM, Eregon (Benoit Daloze) wrote:

> @david_macmahon What about (1..5).step(2).to_a ?

The problem is that it creates a Range, and Enumerator, and an Array =
(plus it's textually long).  That's two extra objects compared to just =
creating a Range and the Array could be very large.  Which of the =
following would you rather do?

```ruby
r =3D 1:12:1e6 # Create Range with step_size 12.
r[42]        # Computes 1+12*42.
```

or

```ruby
a =3D (1..1e6).step(12).to_a # Create Range,
                           # create Enumerator,
                           # and expand to largish Array.
a[42]                      # Get element 42 from the array.
```

Dave