Hello all,
I know it is possible to have a self-referential type like the following
type SelfRef
obj::SelfRef
SelfRef() = (x=new(); x.obj=x)
end
what I want to do is have obj be an array of type SelfRef so I can make a
tree-like structure. I tried the following
type SelfRef
obj::Array{SelfRef,0}
SelfRef() = (x=new(); x.obj=Array(x,0))
end
but that throws the following error (on nightly)
julia> a=SelfRef()
ERROR: no method Array{T,N}(SelfRef)
in SelfRef at none:3
Is there anyway I can make this work?