Exploding enumerables with the splat operator

There are methods having a variable length of parameters. Array#values_at is such a candidate. For example getting objects at specific indexes:

[1, 2, 3, 4, 5].values_at(0, 4) # => [1, 5]

works fine as long as the indexes are predictable. But if the number of indexes or the indexes themselves are generated, there is no other option than dealing with an array and exploding it to a parameter list by using the splat operator:

indexes = [0, 4]

[1, 2, 3, 4, 5].values_at(indexes) # => TypeError: no implicit conversion of Array into Integer
[1, 2, 3, 4, 5].values_at(*indexes) # => [1, 5]

In the following example a number Array is generated by exploding a Range object:

first = 1
last = 5

numbers = (first..last) # => 1..5
numbers = *(first..last) # => [1, 2, 3, 4, 5]

The same principle while doing multiple assignment:

languages = %w(Java Ruby)

static, dynamic = languages
static # => "Java"
dynamic # => "Ruby"

with the splat Operator:

languages = %w(Java Ruby Javascript)

static, *dynamic = languages
static # => "Java"
dynamic # => ["Ruby", "Javascript"]

… so powerful.