From: David Vallner Date: 2006-01-12T00:36:51+09:00 Subject: Re: on parallel assignment Christer Nilsson wrote: >The parallel assignment syntax >[a,b] = [c,d] is not allowed > >I have to write >a, b = [c,d] > >Going deeper >[a, [b, c]] = [1, [2, 3]] is not allowed > >I have to write >a, (b, c) = [1, [2, 3]] > >I'm sure there is a good reason these constructs are disallowed. >Can somebody enlighten me? > >Christer > > > You should check out one of the websites that list upcoming syntax changes in Ruby 2.0 - parallel assignment is undergoing relatively significant changes to weed out possible ambiguity when it's used. As well as nested parallel assignment is concerned, I'd say avoid - it's potentially a very confusing construct, and makes your intent unclear. Arrays usually imply the storing of values of homogenous type and purpose - when used in parallel assignment, it means you're most probably not using them that way, and should probably use a different data structure to store the information to make your code easier to understand. David Vallner