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
This makes it hard to robustly recreate things from their types. ConstructionBase.jl, for example, uses nameof the type to get a constructor that will be robust to things like reconstructing with different eltypes.
julia>using ConstructionBase
julia> T =constructorof(typeof(SA[0.0, 0.0, 0.0]))
SArray
julia T(0, 0, 0)
# Same error
Versions I'm using:
(jl_VtnNO2) pkg> st
Status `/private/var/folders/4z/x1xvpm1d3jd0x24qgrlk9ksm0000gp/T/jl_VtnNO2/Project.toml`
[187b0558] ConstructionBase v1.4.1
[90137ffa] StaticArrays v1.5.9
julia>versioninfo()
Julia Version 1.8.1
Commit afb6c60d69a (2022-09-0615:09 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin21.4.0)
CPU:16×Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
Threads:1 on 8 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =
JULIA_PKG_DEVDIR =/Users/jonnie.diegelman/dev
The text was updated successfully, but these errors were encountered:
jonniediegelman
changed the title
SArray constructor should create an SVector by default?
Should SArray constructor create an SVector by default?
Oct 6, 2022
This issue will be fixed with #1086, but I'm not sure we will have an additional dependency in this package.
julia>using ConstructionBase
julia> T =constructorof(typeof(SA[0.0, 0.0, 0.0]))
SVector (alias for SArray{Tuple{S}, T, 1, S} where {S, T})
julia>T(0,0,0)
3-element SVector{3, Int64} with indices SOneTo(3):000
I think SArray creating SVector by default wouldn't be particularly robust. There just needs to be a package that implements ConstructionBase for StaticArrays.
This makes it hard to robustly recreate things from their types. ConstructionBase.jl, for example, uses
nameof
the type to get a constructor that will be robust to things like reconstructing with differenteltype
s.Versions I'm using:
The text was updated successfully, but these errors were encountered: