```On Tue, Jan 11, 2011 at 7:54 PM, Kedar Mhaswade
> Robert Klemme wrote in post #973945:
>> On Tue, Jan 11, 2011 at 3:29 PM, Kedar Mhaswade
>>>
>>
cecEzOg/edit?hl=3Den#
>>>
>>> Summary is, I should only spend time learning
>>> - x, y, z =3D 1, 2, 3 (# =3D> x=3D1, y=3D1, z=3D3), and
>>> - x, y =3D y, x (# =3D> swap x and y)
>>>
>>> I gather that this might be a matter of taste and style, but are other
>>> variants used by community?
>>
>> Just today I used
>>
>> =A0 def []=3D(*idx, val)
>> =A0 =A0 index_check(idx)
>> =A0 =A0 @data[idx] =3D val
>> =A0 end
>>
>> https://gist.github.com/772827
>>
>>
>> I find the pattern matching _very_ elegant. =A0This also comes in handy
>> in situations like this:
>
> Maybe I am not understanding it, but I thought that elegance is because
> of splat operator (which I am sure I like).

The splat operator is just part of the game as Josh has tried to
demonstrate.  The real power comes from pattern matching which will
even work with multiple levels of nesting.  And the mechanism is the
same for method and block arguments which gives you one powerful
mechanism usable in several places.

> My gripe is about various
> forms of parallel assignment and semantic/syntactic complexity because
> of that. Or are you saying that once you say you need splat operator,
> all this complexity is inevitable (of course, I can work around it by
> not using it, but then how do you all use it?)

No, I am saying that parallel assignment is just a special case of the
assignment mechanism that is also in effect for method and block
arguments.  And while I don't use the fancy variants often (as Josh)
when I use it it yields an elegant solution that would be more
cumbersome without it.

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

```