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
Continuing from #21173 (comment). This is about as minimal as I was able to find (commenting almost anything out, including docstrings, eliminates the issue):
__precompile__(true)
module CoordTforms
using StaticArrays
abstract type Transformation end################################ 2D Coordinate systems ################################"""`Polar{T}(r::T, θ::T)` - 2D polar coordinates"""
immutable Polar{T}
r::T
θ::Tend"`PolarFromCartesian()` - transformation from `AbstractVector` of length 2 to `Polar` type"
immutable PolarFromCartesian <:Transformation; end"`CartesianFromPolar()` - transformation from `Polar` type to `SVector{2}` type"
immutable CartesianFromPolar <:Transformation; endfunction (::PolarFromCartesian)(x::AbstractVector)
length(x) ==2||error("Polar transform takes a 2D coordinate")
Polar(sqrt(x[1]*x[1] + x[2]*x[2]), atan2(x[2], x[1]))
endfunction (::CartesianFromPolar)(x::Polar)
SVector(x.r *cos(x.θ), x.r *sin(x.θ))
end
Base.convert(::Type{Polar}, v::AbstractVector) =PolarFromCartesian()(v)
@inline Base.convert{V <: AbstractVector}(::Type{V}, p::Polar) =convert(V, CartesianFromPolar()(p))
################################ 3D Coordinate Systems ################################"""Spherical(r, θ, ϕ) - 3D spherical coordinates"""
immutable Spherical{T}
r::T
θ::T
ϕ::Tendend
It's worth noting that none of the code in CoordTformsuses StaticArrays. Yet if you comment out the using StaticArrays from inside CoordTforms.jl, the big delay goes away even if you load StaticArrays at the REPL.
Continuing from #21173 (comment). This is about as minimal as I was able to find (commenting almost anything out, including docstrings, eliminates the issue):
Now if you do
and then hit one key, TAB, and a second key, you'll see a very long delay.
The text was updated successfully, but these errors were encountered: