Unpacking block args would be a compiler feature Iβd say yes
Because this feature only works with tuples, not arrays. As the docs point out, itβs a feature when yielding a tuple, the compiler automatically unpacks them. The hash case works because it passes the key and value as a two member tuple as part of its implementation.
EDIT: Tho I think using an array would work, youβd just have to do something like .each do |key, (arg1, arg2)|. I.e. use parentheses to manually unpack the arguments. E.g.
I think the question is: are the both structures equivalent? They look like dictionaries.
The answer is: no.
For instance, try getting the value associated to a key.
x = {'x' => 100, 'y' => 200}
x['x'] # => 100
But:
x = [{'x', 100}, {'y', 200}]
x['x'] # Error: no overload matches 'Array(Tuple(Char, Int32))#[]' with type Char
Another answer: both types have an each method. But they are completely different types. Itβs similar to asking whatβs the difference between 1 and β1β if calling to_s on both gives β1β. Answer: completely different types that happen to have a method with the same name and that produce the same value.