On Friday, August 12, 2016 at 3:59:20 PM UTC-4, Scott T wrote: 
>
> The thing is that this line behaves differently in julia 0.4 and julia 
> 0.5, and it also behaves differently in julia 0.5 and julia 0.5 stepped 
> through with Gallium. Is this some kind of undefined behaviour? I would 
> have expected geta, getb and getc to be evaluated first and for their 
> values to be passed to the function, but the behaviour I'm seeing on julia 
> 0.5 is like it's evaluating them lazily. Have I missed something?
>

No, arguments are always evaluated before the function is called.   I just 
tried it, and it works fine for me with Julia master:

julia> type Foo; a; b; c; end; geta(A) = A.a; getb(A) = A.b; getc(A) = A.c; 
shuffleFields!(A, a, b, c) = (A.a = b; A.b = c; A.c = a)

shuffleFields! (generic function with 1 method)


julia> A = Foo(1,2,3)

Foo(1,2,3)


julia> shuffleFields!(A, getb(A), getc(A), geta(A))

2


julia> A
Foo(3,1,2) 


What do you get with the above code? 

Reply via email to