From Julia's documentation:
Julia function arguments follow a convention sometimes called “pass-by-sharing”...
Does this mean that changing a mutable objects inside the function will also change the object in the caller scope?
But if object is immutable then changing it inside the function will not affect the object in the caller scope? Is it in this case any different from passing by value?
Am I right that adding
!
at the end of function is just a convention, but has no any semantical meaning in compilation?What would be the best way to pass the value of the mutable object of the user-defined composite type? I tried using
copy()
, but got the error saying that thecopy()
is not defined for the my custom type. I guess I need to extend thecopy()
for my custom type. Where I can find the definitions ofcopy()
for other types (would like to use them as a reference when writing extention)?