immutable Bird
   height::Float32
end

immutable Cage
   bird::Bird
end

function catch(some_bird::Bird, some_animal)
    new_bird = Bird(10.2)
    c = Cage(b)
    ...
    new_bird
end

catch(b,b)

1. When are immutable values boxed? Is new_bird a boxed value? What about 
`some_bird` and `some_animal`?
2. I assume that Cage.bird is stored as an immediate value (no pointer). 
Isn't there a risk with large composite types that this is memory and CPU 
inefficient, having to copy it everywhere? Is that a consideration in 
choosing immutable vs. type?

Cédric

Reply via email to