also mut would be used in function prototype to indicate whether the value is mutable or not. if it is primitive then the copy passed to the function would be mutated. if it is a reference then the original object would be mutated.
Example:
fun mutate(mp: mut map<int, bool>) {
mp[1] = true
}
fun main() {
let m = make(map<int, bool>)
mutate(m)
print(mp[1]) // true
}
also
mut
would be used in function prototype to indicate whether the value is mutable or not. if it is primitive then the copy passed to the function would be mutated. if it is a reference then the original object would be mutated.Example: