You cannot choose. You just need to keep in mind that an object that is is Value
passed by value, other objects are passed by reference.
Struct
Value
. . , Crystal , . :
struct Mutable
property value
def initialize(@value : Int32)
end
end
def change(mutable)
mutable.value = 2
mutable
end
mut = Mutable.new 1
mut = change(mut)
mut.value