Yes, it is well-defined. The right-hand side is returned, which might
cause some confusion here.

On Thu, May 8, 2014 at 10:10 AM, Neal Becker <[email protected]> wrote:
> Is the following well-defined in julia?
>
> julia> x = [1:10]
> 10-element Array{Int64,1}:
>   1
>   2
>   3
>   4
>   5
>   6
>   7
>   8
>   9
>  10
>
> julia> x[1:9] = x[2:10]
> 9-element Array{Int64,1}:
>   2
>   3
>   4
>   5
>   6
>   7
>   8
>   9
>  10
>
> In general, are all such aliased assignments well-defined (all, as in for
> arbitrary ranges)?
>

Reply via email to