I want to do something like
struct Test
nParticles::Int64
particleIDs::Vector{Particle}
function Test(nParticles::Int32)
particleIDs = createPmarticles(nParticles)
...
end
end
such that the variable particleIDs is defined inside the type with the help of the first argument nParticles and the function createPmarticles (which is defined somewhere else).
The question is this type of outer constructor is not allowed as far as I can see
LoadError: LoadError: invalid redefinition of type Test
So, is there a way to accomplish this?