diff --git a/docs/final-module/5-cfm.html b/docs/final-module/5-cfm.html
index c565d3465..c10e36885 100644
--- a/docs/final-module/5-cfm.html
+++ b/docs/final-module/5-cfm.html
@@ -517,7 +517,7 @@ function togglePopup(material_id) {
This is part of the extract file inform7_clib.c.
diff --git a/docs/final-module/5-cgv.html b/docs/final-module/5-cgv.html
index f2c9371e7..f871f4de8 100644
--- a/docs/final-module/5-cgv.html
+++ b/docs/final-module/5-cgv.html
@@ -164,7 +164,7 @@ function togglePopup(material_id) {
This is part of the extract file inform7_clib.c.
diff --git a/docs/final-module/5-cim.html b/docs/final-module/5-cim.html
index 68e6a8dea..2cbf5c4a6 100644
--- a/docs/final-module/5-cim.html
+++ b/docs/final-module/5-cim.html
@@ -889,18 +889,8 @@ function togglePopup(material_id) {
}
This is part of the extract file inform7_clib.c.
-
§5.
-
-
-#endif
-
-
This is part of the extract file inform7_clib.h.
-
-#endif
-
-
This is part of the extract file inform7_clib.c.
diff --git a/docs/final-module/5-clt.html b/docs/final-module/5-clt.html
index c176309d2..4f0536916 100644
--- a/docs/final-module/5-clt.html
+++ b/docs/final-module/5-clt.html
@@ -848,7 +848,7 @@ function togglePopup(material_id) {
This is part of the extract file inform7_clib.c.
diff --git a/docs/final-module/5-cmm.html b/docs/final-module/5-cmm.html
index fef4a9be5..a819ff470 100644
--- a/docs/final-module/5-cmm.html
+++ b/docs/final-module/5-cmm.html
@@ -91,17 +91,15 @@ function togglePopup(material_id) {
inthimem; high point of memory: 1 more than the largest legal addressstructtext_stream *array_name;intentry_count;
-intnext_node_is_a_ref;} C_generation_memory_model_data;voidCMemoryModel::initialise_data(code_generation *gen) {C_GEN_DATA(memdata.himem) = 0;C_GEN_DATA(memdata.array_name) = Str::new();C_GEN_DATA(memdata.entry_count) = 0;
-C_GEN_DATA(memdata.next_node_is_a_ref) = FALSE;}
-
The structure C_generation_memory_model_data is accessed in 5/crf, 5/com and here.
+
The structure C_generation_memory_model_data is accessed in 5/com and here.
§2. Byte-addressable memory. The Inter semantics require that there be an area of byte-accessible memory:
@@ -624,55 +622,26 @@ except to predeclare the extent constant, if one was used.
primitive !lookupbyte val val -> val
-intCMemoryModel::handle_store_by_ref(code_generation *gen, inter_tree_node *ref) {
+intCMemoryModel::handle_store_by_ref(code_generation *gen, inter_tree_node *ref) {if (Inter::Reference::node_is_ref_to(gen->from, ref, LOOKUP_BIP)) returnTRUE;if (Inter::Reference::node_is_ref_to(gen->from, ref, LOOKUPBYTE_BIP)) returnTRUE;returnFALSE;}
-intCMemoryModel::invoke_primitive(code_generation *gen, inter_tibip, inter_tree_node *P) {
+intCMemoryModel::invoke_primitive(code_generation *gen, inter_tibip, inter_tree_node *P) {text_stream *OUT = CodeGen::current(gen);switch (bip) {
-caseLOOKUP_BIP:if (CReferences::am_I_a_ref(gen)) Word value as reference16.2
-elseWord value as value16.1;
+caseLOOKUP_BIP:WRITE("i7_read_word(proc, "); VNODE_1C; WRITE(", "); VNODE_2C; WRITE(")");
+break;
+caseLOOKUPBYTE_BIP:WRITE("i7_read_byte(proc, "); VNODE_1C; WRITE(" + "); VNODE_2C; WRITE(")");break;
-caseLOOKUPBYTE_BIP:if (CReferences::am_I_a_ref(gen)) Byte value as reference16.4
-elseByte value as value16.3; break;default:returnNOT_APPLICABLE; }returnFALSE;}
§3. That sets a temporary mode which is immediately detected and cleared by
-the generator for whatever A1 actually is. That generator is expected to call
-this function to detect whether it's a ref. In this mode, A1 is compiled not
-to a valid C expression to evaluate the contents of A1, but instead to a
-function call which will modify A1, and which is missing one or two final
-arguments.
-
-
-
Note that the mode is auto-exited at once. This is all a bit clumsy, but is
-correct.
-
-intCReferences::invoke_primitive(code_generation *gen, inter_tibip, inter_tree_node *P) {
+intCReferences::invoke_primitive(code_generation *gen, inter_tibip, inter_tree_node *P) {text_stream *OUT = CodeGen::current(gen);text_stream *store_form = NULL;switch (bip) {
@@ -162,50 +129,86 @@ correct.
caseCLEARBIT_BIP:store_form = I"i7_lvalue_CLEARBIT"; break;default:returnNOT_APPLICABLE; }
-if (store_form) This does indeed modify a value by reference4.1;
+if (store_form) This does indeed modify a value by reference2.1;returnFALSE;}
-
§4.1. Some storage objects, like variables, can be generated to C code which works
+
§2.1. Some storage objects, like variables, can be generated to C code which works
in either an lvalue or rvalue context. For example, the Inter variable frog
generates just as the C variable i7_mgl_frog.1 It's then fine to generate
code like either 10 + i7_mgl_frog, where it is used in a val context, or
like i7_mgl_frog++, where it is used in a ref context.
-
But other storage objects are not so lucky, and those need to generate to
-different function calls, one used in a ref setting, one used in a val.
-That's what is done by the "A1 as ref" mode set up above.
+
But other storage objects are not so lucky, and can only be written to by
+calling functions.
1 In real life, do not mangle frogs. See C. S. Lewis, "Perelandra", 1943.
↩
-
This does indeed modify a value by reference4.1 =
+
§2.1.4. This is a reference to something else2.1.4 =
@@ -219,71 +222,9 @@ That's what is done by the "A1 as ref" mode set up above.
caseCLEARBIT_BIP:VNODE_1C; WRITE(" = "); VNODE_1C; WRITE(" &~ ("); VNODE_2C; WRITE(")"); break; }
+
+
+
+
+
+
diff --git a/docs/final-module/5-fnc.html b/docs/final-module/5-fnc.html
index 14f7171a2..b37f5238e 100644
--- a/docs/final-module/5-fnc.html
+++ b/docs/final-module/5-fnc.html
@@ -662,7 +662,7 @@ like these other functions: see C Object M