diff options
| author | Cliff Click <cliffc@acm.org> | 2025-01-20 10:02:24 -0800 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-01-20 10:02:24 -0800 |
| commit | e0ab1b3a6fe5205c1d41b91de66254f0c1b46b36 (patch) | |
| tree | 28df0dbc7c6f8b9f0ca59761aa3e3aff9c1073cd | |
| parent | cfecd341531f29ba7d67decdd907071a9e49cf60 (diff) | |
| download | Simple-e0ab1b3a6fe5205c1d41b91de66254f0c1b46b36.tar.gz Simple-e0ab1b3a6fe5205c1d41b91de66254f0c1b46b36.zip | |
more readme updates
| -rw-r--r-- | chapter15/README.md | 2 | ||||
| -rw-r--r-- | chapter16/README.md | 3 | ||||
| -rw-r--r-- | chapter17/README.md | 9 |
3 files changed, 8 insertions, 6 deletions
diff --git a/chapter15/README.md b/chapter15/README.md index d0f2ce60..63305367 100644 --- a/chapter15/README.md +++ b/chapter15/README.md @@ -168,7 +168,7 @@ This means the IR for: becomes `Load(mem,x,Add(Shl(i,3),16))` - `x[i+1]` becomes `16/*base*/ + ((i+1) << 3/*scale*)` becomes + `x[i+1]` becomes `16/*base*/ + ((i+1) << 3/*scale*/)` becomes `Load(mem,x,Add(Shl(i,3),24))` Notice the `idx+1` folds the `+1` into the base math. diff --git a/chapter16/README.md b/chapter16/README.md index 3e29bbae..1489d93d 100644 --- a/chapter16/README.md +++ b/chapter16/README.md @@ -82,7 +82,8 @@ return new Buffer; ## Final fields -Final fields are declared with a `!` before the name: +Final fields are declared with a `!` before the name. +This decision is revisited in the next chapter. ``` int !x = 17; // Final field x diff --git a/chapter17/README.md b/chapter17/README.md index 6c19b642..d56ab7bb 100644 --- a/chapter17/README.md +++ b/chapter17/README.md @@ -46,10 +46,11 @@ infers as Typed primitive fields are always mutable. Typed reference fields without an initializer must be mutable to get a value. Initialized reference variables -are *immutable* by default and can be made mutable with a leading `!`. `var` -and `val` keep their current sense and can be used to make any field mutable or -immutable. Fields are always mutable during construction, but will become -immutable at the end of either constructor. +are immutable by default and can be made mutable with a leading `!`. Contrast +this with what [chapter16](https://github.com/SeaOfNodes/Simple/tree/chapter16) +did with `!`. `var` and `val` keep their current sense and can be used to make +any field mutable or immutable. Fields are always mutable during construction, +but will become immutable at the end of either constructor. `int x; x=3; x++; // OK, primitive so mutable` |
