Hi julia pros,
is the following function safe to be annotated with @pure?
Base.@pure getParameters(t::Type) = Tuple{t.parameters...}
it would be soo awesome, because this indeed supports type inference
Hi julia pros,
is the following function safe to be annotated with @pure?
Base.@pure getParameters(t::Type) = Tuple{t.parameters...}
it would be soo awesome, because this indeed supports type inference
I’d say “yes”.
(I’d also say the function should be named getparameters
or get_parameters
.)
thanks a lot,
(the name just came from my daily Scala work… of course in julia style guide your suggestions or e.g. parametersof
are preferable)
awesome!!!
I believe the function should infer fine without @pure
also.