type croc
  teeth :: Int64
  legs :: Int64
  sons :: Vector{Matrix{Float64}}
  croc() = new(0,0, Vector{Matrix{Float64}}())
  croc(th, gs) = new(th, gs, Vector{Matrix{Float64}}())
  croc(th, gs, ns) = new(th, gs, ns)
end

reptile = croc()
reptile.teeth = 4
reptile.legs = 80
push!(reptile.sons, [[3.0 1.0];[4.0 1.0]])

another = croc(80, 4)

sons = Vector{Matrix{Float64}}()
push!(sons, rand(3,1))
push!(sons, rand(4,1))
onemore = croc(80, 4, sons)

@show reptile
@show another
@show onemore

Reply via email to