I want to call a stagedfunction with a type argument: how do I access that type at the meta stage? I want to define something like:
stagedfunction prevfloat{T<:FloatingPoint,s}(t::Type{T},c::MathConst{s})
bc = big(c())
f = with_rounding(BigFloat,RoundDown) do
convert(T,bc)
end
:(f)
end
However calling prevfloat(Float64,pi) gives me an ERROR: T not defined.
I can't use t instead, as at the meta stage, it has value Type{Float64}. I guess I could define an "untype" function to get access to the parameter, but that seems a bit too complicated. Is there a better way to do this?
-Simon