You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: base/docs/basedocs.jl
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -406,11 +406,11 @@ Assigning `a` to `b` does not create a copy of `b`; instead use [`copy`](@ref) o
406
406
407
407
```jldoctest
408
408
julia> b = [1]; a = b; b[1] = 2; a
409
-
1-element Array{Int64, 1}:
409
+
1-element Vector{Int64}:
410
410
2
411
411
412
412
julia> b = [1]; a = copy(b); b[1] = 2; a
413
-
1-element Array{Int64, 1}:
413
+
1-element Vector{Int64}:
414
414
1
415
415
416
416
```
@@ -420,7 +420,7 @@ julia> function f!(x); x[:] .+= 1; end
420
420
f! (generic function with 1 method)
421
421
422
422
julia> a = [1]; f!(a); a
423
-
1-element Array{Int64, 1}:
423
+
1-element Vector{Int64}:
424
424
2
425
425
426
426
```
@@ -439,7 +439,7 @@ julia> a, b
439
439
Assignment can operate on multiple variables in series, and will return the value of the right-hand-most expression:
440
440
```jldoctest
441
441
julia> a = [1]; b = [2]; c = [3]; a = b = c
442
-
1-element Array{Int64, 1}:
442
+
1-element Vector{Int64}:
443
443
3
444
444
445
445
julia> b[1] = 2; a, b, c
@@ -449,11 +449,11 @@ julia> b[1] = 2; a, b, c
449
449
Assignment at out-of-bounds indices does not grow a collection. If the collection is a [`Vector`](@ref) it can instead be grown with [`push!`](@ref) or [`append!`](@ref).
450
450
```jldoctest
451
451
julia> a = [1, 1]; a[3] = 2
452
-
ERROR: BoundsError: attempt to access 2-element Array{Int64, 1} at index [3]
452
+
ERROR: BoundsError: attempt to access 2-element Vector{Int64} at index [3]
453
453
[...]
454
454
455
455
julia> push!(a, 2, 3)
456
-
4-element Array{Int64, 1}:
456
+
4-element Vector{Int64}:
457
457
1
458
458
1
459
459
2
@@ -467,7 +467,7 @@ ERROR: DimensionMismatch: tried to assign 0 elements to 1 destinations
467
467
[...]
468
468
469
469
julia> filter!(x -> x > 1, a) # in-place & thus more efficient than a = a[a .> 1]
470
-
2-element Array{Int64, 1}:
470
+
2-element Vector{Int64}:
471
471
2
472
472
3
473
473
@@ -490,14 +490,14 @@ assignment expression is converted into a single loop.
490
490
julia> A = zeros(4, 4); B = [1, 2, 3, 4];
491
491
492
492
julia> A .= B
493
-
4×4 Array{Float64, 2}:
493
+
4×4 Matrix{Float64}:
494
494
1.0 1.0 1.0 1.0
495
495
2.0 2.0 2.0 2.0
496
496
3.0 3.0 3.0 3.0
497
497
4.0 4.0 4.0 4.0
498
498
499
499
julia> A
500
-
4×4 Array{Float64, 2}:
500
+
4×4 Matrix{Float64}:
501
501
1.0 1.0 1.0 1.0
502
502
2.0 2.0 2.0 2.0
503
503
3.0 3.0 3.0 3.0
@@ -1018,12 +1018,12 @@ collection or the last index of a dimension of an array.
1018
1018
# Examples
1019
1019
```jldoctest
1020
1020
julia> A = [1 2; 3 4]
1021
-
2×2 Array{Int64, 2}:
1021
+
2×2 Matrix{Int64}:
1022
1022
1 2
1023
1023
3 4
1024
1024
1025
1025
julia> A[end, :]
1026
-
2-element Array{Int64, 1}:
1026
+
2-element Vector{Int64}:
1027
1027
3
1028
1028
4
1029
1029
```
@@ -1429,12 +1429,12 @@ collection or the first index of a dimension of an array. For example,
1429
1429
# Examples
1430
1430
```jldoctest
1431
1431
julia> A = [1 2; 3 4]
1432
-
2×2 Array{Int64,2}:
1432
+
2×2 Matrix{Int64}:
1433
1433
1 2
1434
1434
3 4
1435
1435
1436
1436
julia> A[begin, :]
1437
-
2-element Array{Int64,1}:
1437
+
2-element Matrix{Int64}:
1438
1438
1
1439
1439
2
1440
1440
```
@@ -2826,7 +2826,7 @@ Construct an uninitialized [`Vector{T}`](@ref) of length `n`.
2826
2826
# Examples
2827
2827
```julia-repl
2828
2828
julia> Vector{Float64}(undef, 3)
2829
-
3-element Array{Float64, 1}:
2829
+
3-element Vector{Float64}:
2830
2830
6.90966e-310
2831
2831
6.90966e-310
2832
2832
6.90966e-310
@@ -2876,7 +2876,7 @@ Construct an uninitialized [`Matrix{T}`](@ref) of size `m`×`n`.
2876
2876
# Examples
2877
2877
```julia-repl
2878
2878
julia> Matrix{Float64}(undef, 2, 3)
2879
-
2×3 Array{Float64, 2}:
2879
+
2×3 Matrix{Float64}:
2880
2880
2.36365e-314 2.28473e-314 5.0e-324
2881
2881
2.26704e-314 2.26711e-314 NaN
2882
2882
@@ -3014,7 +3014,7 @@ an alias for `UndefInitializer()`.
`kind` can currently be either `:not_atomic` or `:atomic`. For details on what `:atomic` implies, see [`AtomicMemory`](@ref)
11
11
12
12
`addrspace` can currently only be set to `Core.CPU`. It is designed to permit extension by other systems such as GPUs, which might define values such as:
0 commit comments