Evan Phoenix wrote:
>> Does rubinius evaluates arguments in right-to-left order?
> 
> Yes, it does. Almost every language says that the order that the 
> arguments are evaluated in is "undefined", so I simply had rubinius 
> evaluate them the way that was simplest.

But it does change execution behavior...


def a
   @value = "hello"
end

def b
   @value.reverse
end

def are_equal(x, y)
   x == y
end

are_equal(a, b)

If you evaluate in reverse order, this will fail because @value has not 
been initialized yet. It is perhaps not a very good coding standard, but 
I think argument evaluation is almost always expected to be left to 
right. Another example:

def requery(conn, statement); ... end

requery((@conn = make_connection),
   "select * from #{@conn.query('select name from names where id = 1')}")

Also for []=, where the order expects that the [] args is evaluated 
before the value to be assigned:

a[b ||= 2] = c[b]

Again, perhaps not the best coding practices, but they should be 
expected to work the same.

- Charlie