I am brand new in Julia programming, and am facing a baffling situation, which I simply can't understand. So, this is what I want to do: I have two structs: Shoe and Person, where Person contains a Shoe
This is how the code looks:
struct Shoe
size :: Int64
brand :: String
end
struct Person
age :: Int64
shoe :: Shoe
function Person(a::Int64, s::Shoe)
age = a
shoe = s
end
function Person()
age = 33
shoe = Shoe(17,"Nike")
end
end
ian = Person(17, Shoe(32,"Puma"))
tom = Person()
println(typeof(ian))
println(typeof(tom))
To my utter surprise, ian and tom, which I try to define as persons, turn out to be shoes. Any idea what am I doing wrong?