From ef7577136b942819d4cff2f8c63605744e854f75 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 11 May 2025 11:43:10 -0700 Subject: Clean up stacked mergemem --- chapter23/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'chapter23') diff --git a/chapter23/README.md b/chapter23/README.md index 433ecf03..5625fa61 100644 --- a/chapter23/README.md +++ b/chapter23/README.md @@ -12,8 +12,14 @@ You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linea The idea is that structs have fields indexed by names, and arrays have fields indexed by numbers, and these ideas are compatible with each other. This idea -has been used by the C language for a long time - following a normal struct C -allows an array and can index it with the usual array syntax. +has been used by the C language for a long time - an array can follow a normal +struct C and can index it with the usual array syntax. + +The alternative, using a field to hold a pointer to an array, exchanges some +flexibility for an extra indirection. The obvious flexibility allows swapping +the array out (generally for a larger one) and this is the basis of very common +`Vector` or `ArrayList` generic containers. + ```java struct str { -- cgit v1.2.3