David A. Black wrote:
> 
> I believe that a subscript expression is always going to be evaluated
> first:
> 
> irb(main):001:0> a = [1,2,3,4,5]
> => [1, 2, 3, 4, 5]
> irb(main):002:0> b = 1
> => 1
> irb(main):003:0> a[b] = (b = 10)
> => 10
> irb(main):004:0> a
> => [1, 10, 3, 4, 5]
>

I think you missed Mariusz P??kala's point:

Mariusz P??kala wrote:
> On 2007-10-02 21:06:32 +0900 (Tue, Oct), Calamitas wrote:
>> 
>> Arguments are evaluated left to right, completely explaining the
>> evaluation order the OP is seeing.
> 

I guess it's safer to say that the order of evaluating arguments is
undefined, unless it is stated somewhere.

Is it defined for ruby?
----------

In other words, I think Mariusz was pointing out that, yes the subscript 
expressions are evaluated before the assignments, but does that 
necessarily mean the subscript expressions are guaranteed to be 
evaluated left to right.  Since your example only has one subscript 
expression, it doesn't shed any light on that issue.

-- 
Posted via http://www.ruby-forum.com/.