On 02/15/2010 05:50 PM, Jesús Gabriel y Galán wrote:
> 2010/2/15 Jesús Gabriel y Galán <>:
>> I think it might be because the parallel assigment creates an array
>> under the hood?
However it is done technically, parallel assignment needs more space
because it has to evaluate *all* right hand sides before doing any
assignments. Otherwise swapping would not be possible
a, b = b, a
So, yes, it's likely an Array under the hood but even if not the
parallel assignment of two variables needs to store two object
references while sequential assignments of an arbitrary number of
elements gets away with space for a single reference (if you need it at
all).
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/