Skip to content

Commit 75fdd86

Browse files
authored
clarify at-views docstring (#52374)
1 parent fa69f9c commit 75fdd86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

base/views.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,16 @@ Similarly, `@views` converts string slices into [`SubString`](@ref) views.
224224
occurs in functions called by that code.
225225
226226
!!! compat "Julia 1.5"
227-
Using `begin` in an indexing expression to refer to the first index requires at least
228-
Julia 1.5.
227+
Using `begin` in an indexing expression to refer to the first index was implemented
228+
in Julia 1.4, but was only supported by `@views` starting in Julia 1.5.
229229
230230
# Examples
231231
```jldoctest
232232
julia> A = zeros(3, 3);
233233
234234
julia> @views for row in 1:3
235-
b = A[row, :]
236-
b[:] .= row
235+
b = A[row, :] # b is a view, not a copy
236+
b .= row # assign every element to the row index
237237
end
238238
239239
julia> A

0 commit comments

Comments
 (0)