I'd like to define in Julia a composite type which contains a variable length array of another composite type. It's better explained by an example. Let's say I have the type
type p
c::Int
p() = new(0)
end
which I don't really care about. The problem is when I try to define the type
type pp
len::Int
arr::Array{p}(1, len)
end
Obviously I get an error like "len not defined" and I don't know how to fix it. Moreover, how should I define then the constructor of type pp
? I'm new to Julia and I'm not even sure if what I'm asking is actually possible.
arr
is of lengthlen
. – Gnimuc