Skip to content

Commit

Permalink
Merge pull request #4240 from kpreid/patch-1
Browse files Browse the repository at this point in the history
Appendix B, Operators: Replace “member access” with “field access” and “method call”.
  • Loading branch information
chriskrycho authored Feb 25, 2025
2 parents c7edf19 + 0833386 commit ca030dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/appendix-02-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ overload that operator is listed.
| `-` | `expr - expr` | Arithmetic subtraction | `Sub` |
| `-=` | `var -= expr` | Arithmetic subtraction and assignment | `SubAssign` |
| `->` | `fn(...) -> type`, <code>&vert;...&vert; -> type</code> | Function and closure return type | |
| `.` | `expr.ident` | Member access | |
| `.` | `expr.ident` | Field access | |
| `.` | `expr.ident(expr, ...)` | Method call | |
| `.` | `expr.0`, `expr.1`, etc. | Tuple indexing | |
| `..` | `..`, `expr..`, `..expr`, `expr..expr` | Right-exclusive range literal | `PartialOrd` |
| `..=` | `..=expr`, `expr..=expr` | Right-inclusive range literal | `PartialOrd` |
| `..` | `..expr` | Struct literal update syntax | |
Expand Down Expand Up @@ -168,9 +170,9 @@ Table B-7 shows symbols that create comments.
| `/*!...*/` | Inner block doc comment |
| `/**...*/` | Outer block doc comment |

Table B-8 shows symbols that appear in the context of using tuples.
Table B-8 shows the contexts in which parentheses are used.

<span class="caption">Table B-8: Tuples</span>
<span class="caption">Table B-8: Parentheses</span>

| Symbol | Explanation |
| ------------------------ | ------------------------------------------------------------------------------------------- |
Expand All @@ -181,7 +183,6 @@ Table B-8 shows symbols that appear in the context of using tuples.
| `(expr, ...)` | Tuple expression |
| `(type, ...)` | Tuple type |
| `expr(expr, ...)` | Function call expression; also used to initialize tuple `struct`s and tuple `enum` variants |
| `expr.0`, `expr.1`, etc. | Tuple indexing |

Table B-9 shows the contexts in which curly braces are used.

Expand Down

0 comments on commit ca030dd

Please sign in to comment.