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
Create an uninitialized mutable array analogous to that specified by
`storagetype`, but with `axes` specified by the last
argument. `storagetype` might be a type or a function.
What does it mean for storagetype to be a function? I have tried to find a method for similar() that accepts a function for its first argument, but to no avail:
julia>methods(similar, (Any, NTuple))
# 6 methods for generic function "similar":
[1] similar(a::Array{T,N}where N, dims::Tuple{Vararg{Int64,N}}) where {T, N} in Base at array.jl:381
[2] similar(B::BitArray, dims::Tuple{Vararg{Int64,N}}where N) in Base at bitarray.jl:370
[3] similar(S::SharedArrays.SharedArray, dims::Tuple{Vararg{Int64,N}}where N) in SharedArrays at /Users/Ron/Applications/Julia-1.5.app/Contents/Resources/julia/share/julia/stdlib/v1.5/SharedArrays/src/SharedArrays.jl:564
[4] similar(a::AbstractArray{T,N}where N, dims::Tuple) where T in Base at abstractarray.jl:630
[5] similar(::Type{T}, dims::Tuple{Vararg{Int64,N}}where N) where T<:AbstractArrayin Base at abstractarray.jl:675
[6] similar(::Type{T}, shape::Tuple{Union{Integer, Base.OneTo},Vararg{Union{Integer, Base.OneTo},N} where N}) where T<:AbstractArrayin Base at abstractarray.jl:674
julia>methods(similar, (Any, Vararg{AbstractRange,N} where N))
# 11 methods for generic function "similar":
[…] # methods with empty varargs elided
[4] similar(B::BitArray, dims::Int64...) in Base at bitarray.jl:369
[…]
[8] similar(A::Test.GenericArray, s::Integer...) in Test at /Users/Ron/Applications/Julia-1.5.app/Contents/Resources/julia/share/julia/stdlib/v1.5/Test/src/Test.jl:1654
[…]
[10] similar(a::AbstractArray{T,N}where N, dims::Union{Integer, AbstractUnitRange}...) where T in Base at abstractarray.jl:631
[11] similar(::Type{T}, dims::Union{Integer, AbstractUnitRange}...) where T<:AbstractArrayin Base at abstractarray.jl:673
The text was updated successfully, but these errors were encountered:
In the documentation for
similar()
, the following is written:julia/base/abstractarray.jl
Lines 711 to 715 in 1c9c241
What does it mean for
storagetype
to be a function? I have tried to find a method forsimilar()
that accepts a function for its first argument, but to no avail:The text was updated successfully, but these errors were encountered: