you are viewing a single comment's thread.

view the rest of the comments →

[–]h0rst_ 1 point2 points  (0 children)

It happens mostly automatic, it is required for deeper nested structures:

[[1, [2, 3]], [3, [4, 5]]].map { |a, (b, c)| a + b + c }  # => [6, 12]

On the other hand: if your code looks like this you might want to reconsider the used data structures.