Mutable References
Values in pyr are immutable by default. To let a function modify a struct's fields, the parameter must be declared as *mut and the caller must pass &mut explicitly. This makes mutation visible at every call site.
Function parameters are immutable by default. Field assignment on a non- |
|
|
|
Read-only access needs no special syntax. |
|
At the call site, |
|
$ pyr run pointers.pyr 3 11 22 |