Closed andreasnoack closed 3 years ago
...instead of the value that is being set. This is the usual interface
julia> setindex!(ones(3), 2, 1) 3-element Vector{Float64}: 2.0 1.0 1.0
The bracket syntax lowers specially to return the value instead
julia> ones(3)[1] = 2 2 julia> Meta.lower(Main, :(ones(3)[1] = 2)) :($(Expr(:thunk, CodeInfo( @ none within `top-level scope' 1 ─ %1 = ones(3) │ Base.setindex!(%1, 2, 1) └── return 2 ))))
...instead of the value that is being set. This is the usual interface
The bracket syntax lowers specially to return the value instead