@@ -9,8 +9,8 @@ h1. Chapter 3: Names and Name Table
99
1010h2. `st_table`
1111
12- We've already examined `st_table` as a method table and an instance table. In
13- this chapter let's look at the inner workings of `st_table`.
12+ `st_table` has already appeared several times as a method table and an instance
13+ table. In this chapter let's look at the structure of the `st_table` in detail .
1414
1515h3. Summary
1616
@@ -19,7 +19,8 @@ table? It is a data structure that records one-to-one relations, for example, a
1919variable name and its value, or a function name and its body, etc.
2020
2121However, data structures other than hash tables can, of course, record
22- one-to-one relations. For example, a linked list will suffice for this purpose.
22+ one-to-one relations. For example, a list of the following structs will suffice
23+ for this purpose.
2324
2425<pre class="emlist">
2526struct entry {
@@ -63,9 +64,10 @@ A hash table can be thought as the following: Let us think of an array with
6364
6465Then let us specify a function `f` that takes a key and produces an integer `i`
6566from 0 to `n`-1 (0-63). We call this `f` a hash function. `f` when given the
66- same key always produces the same `i`. For example, if we assume that the key
67- is limited to positive integers, we can make the function `f` by dividing the
68- key by 64. The remainder will always fall between 0 and 63.
67+ same key always produces the same `i`. For example, if we can assume that the
68+ key is limited to positive integers, when the key is divided by 64, the
69+ remainder should always fall between 0 and 63. Therefore, this calculating
70+ expression has a possibility of being the function `f`.
6971
7072When recording relationships, given a key, function `f` generates `i`, and
7173places the value into index `i` of the array we have prepared. Index access
0 commit comments