I do not know, maybe this is too simplistic but I think it boils down to:
julia> [1, 2, 3] .= [4, 5, 6]
3-element Vector{Int64}:
4
5
6
julia> [1, 2, 3] = [4, 5, 6]
ERROR: syntax: invalid assignment location "[1, 2, 3]" around REPL[3]:1
Stacktrace:
[1] top-level scope
@ REPL[3]:1
=
is impossible to implement as a method, because it does not take x
as any value/object bound to that name (which in fact, may not exist yet, the name may be undefined before, we may be declaring it at that point), instead, it takes x
as a symbol like a macro would.
.=
, on the other hand, is just a method, and it does not care or even is aware if the first operand (LHS) is a name, a literal, or just any expression that returns a value, it just touches the values of both sides, as any method (and most operators) do.