From e4dc3273f201ae741637b626998637cce973546b Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 2 Oct 2026 13:04:34 -0700 Subject: First pass README updates --- chapter23/README.md | 65 ++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'chapter23') diff --git a/chapter23/README.md b/chapter23/README.md index 502387eb..debbf6dc 100644 --- a/chapter23/README.md +++ b/chapter23/README.md @@ -1,5 +1,8 @@ # Chapter 23: Methods and Revisiting Types +[Previous: Chapter 22](../chapter22/README.md) | +[Next: Chapter 24](../chapter24/README.md) + In this chapter we add *methods*, functions defined in structs which take a hidden `self` argument and can access the struct fields. Here is an `indexOf` method in a String-like class: @@ -8,7 +11,7 @@ hidden `self` argument and can access the struct fields. Here is an // A String-like class, with methods struct String { u8[~] buf; // Buffer of read-only characters - + // Return the index of the first character 'c' or -1 val indexOf = { u8 c -> // Hidden 'self' argument for( int i=0; i