Skip to content

Commit 53fd617

Browse files
authored
Clarify &
1 parent e76854d commit 53fd617

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public fun main() {
4848
```
4949

5050
This program declares two character strings, appends an exclamation mark to the longest, and prints them both after the mutation.
51-
No unecessary allocation occurs.
51+
No pointers or references are used (`&` in Val does not mean “address of”—it simply marks a mutation), and no unecessary allocation occurs.
5252
The result of `longer_of` is a *projection* of the longer argument, so the mutation of `z` by `emphasize` occurs directly on the value of `y`. The value is neither copied, nor moved, and yet it is not being passed by reference to `emphasize`.
5353
The body of `emphasize` *owns* `z` in exactly the same way as it owns `strength`, which is passed by value: `z` is an independent value that can only be touched by `emphasize`.
5454

0 commit comments

Comments
 (0)