diff --git a/docs/inform7/M-cifc.html b/docs/inform7/M-cifc.html index 764fe88ae..286f81773 100644 --- a/docs/inform7/M-cifc.html +++ b/docs/inform7/M-cifc.html @@ -533,8 +533,34 @@ the sender function to The story, such as it is: +
+ ++Jarn Mound is a room. + +Age is a kind of value. The ages are modern, antique and ancient. A thing has +an age. The age of a thing is usually modern. + +In the Mound is a Linear B tablet. The tablet is ancient. The player is wearing +a watch. + +The meaning is a text that varies. The meaning is "4 oxen, 1 broken tripod table." + +Instead of examining the watch: + say "It is approximately [time of day]." + +Report examining the tablet: + say "It is [age of tablet], and translates to '[meaning]'." + +When play begins: + now the command prompt is ""; + say "Sir Arthur Evans, hero and archeologist, invites you to explore..." +
In this example the C program is:
@@ -546,13 +572,24 @@ feed a textual command back to I7 which would then be parsed into actions. i7process_t proc = i7_new_process(); i7_set_process_sender(&proc, NULL); if (i7_run_process(&proc) == 0) { + i7val t = i7_read_variable(&proc, i7_V_the_time); + printf("[C program reads 'time of day' as %d]\n", t); + i7val A = i7_read_prop_value(&proc, i7_I_Linear_B_tablet, i7_P_age); + printf("[C program reads 'age of Linear B tablet' as %d]\n", A); i7_try(&proc, i7_A_Take, i7_I_Linear_B_tablet, 0); i7_try(&proc, i7_A_Inv, 0, 0); + i7_write_variable(&proc, i7_V_the_time, 985); + i7_try(&proc, i7_A_Examine, i7_I_watch, 0); + i7_write_variable(&proc, i7_V_the_time, 995); + i7_try(&proc, i7_A_Examine, i7_I_watch, 0); + i7_write_prop_value(&proc, i7_I_Linear_B_tablet, i7_P_age, i7_I_modern); + i7_try(&proc, i7_A_Examine, i7_I_Linear_B_tablet, 0); + return 0; } else { printf("*** Fatal error: halted ***\n"); fflush(stdout); fflush(stderr); + return 1; } - return exit_code; }Note that a header file called inform7_symbols.h is included. This defines
@@ -589,19 +626,36 @@ before compiling Eg6-C.cWelcome
An Interactive Fiction
-Release 1 / Serial number 210918 / Inform 7 v10.1.0 / D
+Release 1 / Serial number 210919 / Inform 7 v10.1.0 / D
Jarn Mound
You can see a Linear B tablet here.
+[C program reads 'time of day' as 540]
+[C program reads 'age of Linear B tablet' as 3]
Taken.
You are carrying:
a Linear B tablet
- an iPhone
+ a watch (being worn)
+
+It is approximately 4:25 pm.
+
+It is approximately 4:35 pm.
+
+You see nothing special about the Linear B tablet.
+
+It is modern, and translates to "4 oxen, 1 broken tripod table.".
- Though this example doesn't use them, the following functions are also
-available:
+ Here we see a run of responses, as if to unheard commands: those of course
+are the actions sent directly to the process by i7_try.
+ §12. Example 6 used most of the following suite of functions for looking at or
+altering the Inform data.
+ First, some functions which can only be applied to instances of object:
Second, functions to look at global variables:
+ Note that where variables are created by kits such as WorldModelKit, their ID
+constants have names based on the names they have in those kits: thus i7_V_the_time
+refers to the time of day, not i7_V_time_of_day. Browsing inform7_symbols.h
+will usually make things clear, anyway.
+ Finally, properties of objects can similarly be read or written:
+ If you need access to other data inside the Inform program, it's better to
+process it at the Inform end. These functions are just a convenience for what's
+most often needed.
+
+
+
+
100.0% in inform7 run
- 54.2% in compilation to Inter
- 39.1% in Sequence::undertake_queued_tasks
- 3.4% in MajorNodes::pre_pass
- 2.4% in MajorNodes::pass_1
- 2.0% in RTPhrasebook::compile_entries
- 1.3% in ImperativeDefinitions::assess_all
- 1.0% in RTKindConstructors::compile
- 0.4% in ImperativeDefinitions::compile_first_block
+ 54.5% in compilation to Inter
+ 39.3% in Sequence::undertake_queued_tasks
+ 3.5% in MajorNodes::pre_pass
+ 2.5% in MajorNodes::pass_1
+ 1.9% in RTPhrasebook::compile_entries
+ 1.4% in ImperativeDefinitions::assess_all
+ 1.1% in RTKindConstructors::compile
0.4% in MajorNodes::pass_2
0.4% in Sequence::undertake_queued_tasks
- 0.4% in Sequence::undertake_queued_tasks
0.4% in World::stage_V
0.2% in CompletionModule::compile
+ 0.2% in ImperativeDefinitions::compile_first_block
+ 0.2% in Sequence::undertake_queued_tasks
0.1% in InferenceSubjects::emit_all
0.1% in RTKindConstructors::compile_permissions
0.1% in Task::make_built_in_kind_constructors
0.1% in World::stages_II_and_III
1.9% not specifically accounted for
- 43.8% in running Inter pipeline
- 12.2% in step preparation
- 9.5% in inter step 7/16: consolidate-text
- 7.8% in inter step 16/16: generate inform6 -> auto.inf
- 7.8% in inter step 2/16: link
- 1.4% in inter step 11/16: make-identifiers-unique
+ 43.4% in running Inter pipeline
+ 12.4% in step preparation
+ 9.4% in inter step 7/16: consolidate-text
+ 7.9% in inter step 16/16: generate inform6 -> auto.inf
+ 7.6% in inter step 2/16: link
+ 1.5% in inter step 11/16: make-identifiers-unique
0.4% in inter step 12/16: reconcile-verbs
- 0.2% in inter step 10/16: detect-indirect-calls
0.2% in inter step 14/16: eliminate-redundant-operations
0.2% in inter step 6/16: assimilate
0.2% in inter step 8/16: resolve-external-symbols
0.2% in inter step 9/16: inspect-plugs
+ 0.1% in inter step 10/16: detect-indirect-calls
0.1% in inter step 13/16: eliminate-redundant-labels
0.1% in inter step 4/16: parse-linked-matter
0.1% in inter step 5/16: resolve-conditional-compilation
- 2.6% not specifically accounted for
+ 2.3% not specifically accounted for
1.6% in supervisor
0.3% not specifically accounted for
@@ -128,12 +128,12 @@ represent less than 1/1000th of the total.
-Total memory consumption was 393897K = 385 MB +Total memory consumption was 394708K = 385 MB -60.7% was used for 1996964 objects, in 371202 frames in 299 x 800K = 239200K = 233 MB: +60.8% was used for 1997066 objects, in 371205 frames in 300 x 800K = 240000K = 234 MB: 10.3% inter_tree_node_array 58 x 8192 = 475136 objects, 41813824 bytes - 7.1% text_stream_array 5142 x 100 = 514200 objects, 28959744 bytes + 7.1% text_stream_array 5143 x 100 = 514300 objects, 28965376 bytes 4.2% linked_list 30852 objects, 17277120 bytes 3.9% inter_symbol_array 139 x 1024 = 142336 objects, 15946080 bytes 2.5% parse_node 129365 objects, 10349200 bytes @@ -171,7 +171,7 @@ represent less than 1/1000th of the total. ---- compilation_subtask 3346 objects, 267680 bytes ---- inference_subject 665 objects, 260680 bytes ---- inter_annotation_array 1 x 8192 objects, 196640 bytes - ---- hierarchy_location 1116 objects, 169632 bytes + ---- hierarchy_location 1117 objects, 169784 bytes ---- binary_predicate 321 objects, 169488 bytes ---- linguistic_stock_item 3316 objects, 159168 bytes ---- rule_family_data 400 objects, 147200 bytes @@ -180,7 +180,7 @@ represent less than 1/1000th of the total. ---- documentation_ref 1273 objects, 112024 bytes ---- inference 1703 objects, 108992 bytes ---- imperative_defn 1376 objects, 99072 bytes - ---- inter_tree 6 objects, 98304 bytes + ---- inter_tree 6 objects, 98352 bytes ---- noun_usage 2402 objects, 96080 bytes ---- anl_entry_array 2 x 1000 = 2000 objects, 96064 bytes ---- preposition 273 objects, 87360 bytes @@ -239,7 +239,7 @@ represent less than 1/1000th of the total. ---- booking_list 407 objects, 13024 bytes ---- adjective_iname_holder 320 objects, 12800 bytes ---- pathname 296 objects, 11840 bytes - ---- uniqueness_count 454 objects, 10896 bytes + ---- uniqueness_count 455 objects, 10920 bytes ---- stopwatch_timer 114 objects, 9120 bytes ---- filename 207 objects, 8280 bytes ---- equation_node 68 objects, 7616 bytes @@ -366,10 +366,10 @@ represent less than 1/1000th of the total. ---- loop_over_scope 1 object, 40 bytes ---- I6_generation_data 1 object, 24 bytes -39.2% was used for memory not allocated for objects: +39.1% was used for memory not allocated for objects: - 20.4% text stream storage 82535560 bytes in 532329 claims - 4.5% dictionary storage 18176000 bytes in 33267 claims + 20.4% text stream storage 82547652 bytes in 532461 claims + 4.4% dictionary storage 18176000 bytes in 33267 claims ---- sorting 744 bytes in 3 claims 1.7% source text 7200000 bytes in 3 claims 2.6% source text details 10800000 bytes in 2 claims @@ -386,7 +386,7 @@ represent less than 1/1000th of the total. ---- code generation workspace for objects 9624 bytes in 9 claims ---- emitter array storage 161792 bytes in 2062 claims -18.6% was overhead - 75034160 bytes = 73275K = 71 MB +18.7% was overhead - 75847504 bytes = 74069K = 72 MB
§4. Preform grammar. The full annotated description of the Preform grammar (see About Preform (in words)),
with optimisation details and hit/miss statistics added, is also long: it's
diff --git a/docs/runtime-module/2-hrr.html b/docs/runtime-module/2-hrr.html
index 595ed22e0..c9d598773 100644
--- a/docs/runtime-module/2-hrr.html
+++ b/docs/runtime-module/2-hrr.html
@@ -1982,6 +1982,7 @@ that the compiler can refer to it.
enum VARIABLE_UNDERSTOOD_MD_HL
enum VARIABLE_CONTENTS_MD_HL
enum VARIABLE_DOCUMENTATION_MD_HL
+enum VARIABLE_COUNTERPART_MD_HL
enum VARIABLE_HL
enum COMMANDPROMPTTEXT_HL
enum INITIAL_MAX_SCORE_HL
@@ -2001,6 +2002,7 @@ that the compiler can refer to it.
H_C_U(VARIABLE_UNDERSTOOD_MD_HL, I"^understood")
H_C_U(VARIABLE_CONTENTS_MD_HL, I"^contents")
H_C_U(VARIABLE_DOCUMENTATION_MD_HL, I"^documentation")
+ H_C_U(VARIABLE_COUNTERPART_MD_HL, I"^counterpart")
H_C_G(VARIABLE_HL, I"V")
H_F_T(COMMANDPROMPTTEXT_HL, I"command_prompt_text_fn", I"CommandPromptText")
H_C_T(INITIAL_MAX_SCORE_HL, I"INITIAL_MAX_SCORE")
@@ -2416,7 +2418,7 @@ point system, and for those:
Emit::numeric_constant(iname, N);
}
-void Hierarchy::apply_metadata_from_iname(package_request *P, int id, inter_name *val) {
+void Hierarchy::apply_metadata_from_iname(package_request *P, int id, inter_name *val) {
inter_name *iname = Hierarchy::make_iname_in(id, P);
Emit::iname_constant(iname, K_value, val);
}
diff --git a/docs/runtime-module/5-vrb.html b/docs/runtime-module/5-vrb.html
index 82cd90d58..c5a6e6035 100644
--- a/docs/runtime-module/5-vrb.html
+++ b/docs/runtime-module/5-vrb.html
@@ -432,6 +432,8 @@ compiled code, of course.
inter_symbol *S = InterNames::to_symbol(iname);
inter_symbol *H = InterNames::to_symbol(nlv->compilation_data.lvalue_nve.iname_form);
InterSymbolsTables::equate(S, H);
+ Hierarchy::apply_metadata_from_iname(pack, VARIABLE_COUNTERPART_MD_HL,
+ nlv->compilation_data.lvalue_nve.iname_form);
}
}
Add any anomalous extras14.1;
diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt
index adb449a17..4a83204f4 100644
--- a/inform7/Figures/memory-diagnostics.txt
+++ b/inform7/Figures/memory-diagnostics.txt
@@ -1,9 +1,9 @@
-Total memory consumption was 393897K = 385 MB
+Total memory consumption was 394708K = 385 MB
-60.7% was used for 1996964 objects, in 371202 frames in 299 x 800K = 239200K = 233 MB:
+60.8% was used for 1997066 objects, in 371205 frames in 300 x 800K = 240000K = 234 MB:
10.3% inter_tree_node_array 58 x 8192 = 475136 objects, 41813824 bytes
- 7.1% text_stream_array 5142 x 100 = 514200 objects, 28959744 bytes
+ 7.1% text_stream_array 5143 x 100 = 514300 objects, 28965376 bytes
4.2% linked_list 30852 objects, 17277120 bytes
3.9% inter_symbol_array 139 x 1024 = 142336 objects, 15946080 bytes
2.5% parse_node 129365 objects, 10349200 bytes
@@ -41,7 +41,7 @@ Total memory consumption was 393897K = 385 MB
---- compilation_subtask 3346 objects, 267680 bytes
---- inference_subject 665 objects, 260680 bytes
---- inter_annotation_array 1 x 8192 objects, 196640 bytes
- ---- hierarchy_location 1116 objects, 169632 bytes
+ ---- hierarchy_location 1117 objects, 169784 bytes
---- binary_predicate 321 objects, 169488 bytes
---- linguistic_stock_item 3316 objects, 159168 bytes
---- rule_family_data 400 objects, 147200 bytes
@@ -50,7 +50,7 @@ Total memory consumption was 393897K = 385 MB
---- documentation_ref 1273 objects, 112024 bytes
---- inference 1703 objects, 108992 bytes
---- imperative_defn 1376 objects, 99072 bytes
- ---- inter_tree 6 objects, 98304 bytes
+ ---- inter_tree 6 objects, 98352 bytes
---- noun_usage 2402 objects, 96080 bytes
---- anl_entry_array 2 x 1000 = 2000 objects, 96064 bytes
---- preposition 273 objects, 87360 bytes
@@ -109,7 +109,7 @@ Total memory consumption was 393897K = 385 MB
---- booking_list 407 objects, 13024 bytes
---- adjective_iname_holder 320 objects, 12800 bytes
---- pathname 296 objects, 11840 bytes
- ---- uniqueness_count 454 objects, 10896 bytes
+ ---- uniqueness_count 455 objects, 10920 bytes
---- stopwatch_timer 114 objects, 9120 bytes
---- filename 207 objects, 8280 bytes
---- equation_node 68 objects, 7616 bytes
@@ -236,10 +236,10 @@ Total memory consumption was 393897K = 385 MB
---- loop_over_scope 1 object, 40 bytes
---- I6_generation_data 1 object, 24 bytes
-39.2% was used for memory not allocated for objects:
+39.1% was used for memory not allocated for objects:
- 20.4% text stream storage 82535560 bytes in 532329 claims
- 4.5% dictionary storage 18176000 bytes in 33267 claims
+ 20.4% text stream storage 82547652 bytes in 532461 claims
+ 4.4% dictionary storage 18176000 bytes in 33267 claims
---- sorting 744 bytes in 3 claims
1.7% source text 7200000 bytes in 3 claims
2.6% source text details 10800000 bytes in 2 claims
@@ -256,5 +256,5 @@ Total memory consumption was 393897K = 385 MB
---- code generation workspace for objects 9624 bytes in 9 claims
---- emitter array storage 161792 bytes in 2062 claims
-18.6% was overhead - 75034160 bytes = 73275K = 71 MB
+18.7% was overhead - 75847504 bytes = 74069K = 72 MB
diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt
index 85249ac44..855493fa7 100644
--- a/inform7/Figures/timings-diagnostics.txt
+++ b/inform7/Figures/timings-diagnostics.txt
@@ -1,37 +1,37 @@
100.0% in inform7 run
- 54.2% in compilation to Inter
- 39.1% in //Sequence::undertake_queued_tasks//
- 3.4% in //MajorNodes::pre_pass//
- 2.4% in //MajorNodes::pass_1//
- 2.0% in //RTPhrasebook::compile_entries//
- 1.3% in //ImperativeDefinitions::assess_all//
- 1.0% in //RTKindConstructors::compile//
- 0.4% in //ImperativeDefinitions::compile_first_block//
+ 54.5% in compilation to Inter
+ 39.3% in //Sequence::undertake_queued_tasks//
+ 3.5% in //MajorNodes::pre_pass//
+ 2.5% in //MajorNodes::pass_1//
+ 1.9% in //RTPhrasebook::compile_entries//
+ 1.4% in //ImperativeDefinitions::assess_all//
+ 1.1% in //RTKindConstructors::compile//
0.4% in //MajorNodes::pass_2//
0.4% in //Sequence::undertake_queued_tasks//
- 0.4% in //Sequence::undertake_queued_tasks//
0.4% in //World::stage_V//
0.2% in //CompletionModule::compile//
+ 0.2% in //ImperativeDefinitions::compile_first_block//
+ 0.2% in //Sequence::undertake_queued_tasks//
0.1% in //InferenceSubjects::emit_all//
0.1% in //RTKindConstructors::compile_permissions//
0.1% in //Task::make_built_in_kind_constructors//
0.1% in //World::stages_II_and_III//
1.9% not specifically accounted for
- 43.8% in running Inter pipeline
- 12.2% in step preparation
- 9.5% in inter step 7/16: consolidate-text
- 7.8% in inter step 16/16: generate inform6 -> auto.inf
- 7.8% in inter step 2/16: link
- 1.4% in inter step 11/16: make-identifiers-unique
+ 43.4% in running Inter pipeline
+ 12.4% in step preparation
+ 9.4% in inter step 7/16: consolidate-text
+ 7.9% in inter step 16/16: generate inform6 -> auto.inf
+ 7.6% in inter step 2/16: link
+ 1.5% in inter step 11/16: make-identifiers-unique
0.4% in inter step 12/16: reconcile-verbs
- 0.2% in inter step 10/16: detect-indirect-calls
0.2% in inter step 14/16: eliminate-redundant-operations
0.2% in inter step 6/16: assimilate
0.2% in inter step 8/16: resolve-external-symbols
0.2% in inter step 9/16: inspect-plugs
+ 0.1% in inter step 10/16: detect-indirect-calls
0.1% in inter step 13/16: eliminate-redundant-labels
0.1% in inter step 4/16: parse-linked-matter
0.1% in inter step 5/16: resolve-conditional-compilation
- 2.6% not specifically accounted for
+ 2.3% not specifically accounted for
1.6% in supervisor
0.3% not specifically accounted for
diff --git a/inform7/Manual/Calling Inform from C.w b/inform7/Manual/Calling Inform from C.w
index 8ef054d0c..4e998cb94 100644
--- a/inform7/Manual/Calling Inform from C.w
+++ b/inform7/Manual/Calling Inform from C.w
@@ -396,6 +396,31 @@ What will happen then is that the |i7_run_process| function will return at
the point where a command would have been requested. The C function can then
trigger whatever actions it wants, in the world model, without the need to
feed a textual command back to I7 which would then be parsed into actions.
+In this example we do just that, and also examine and modify the data belonging
+to the I7 program from C.
+
+The story, such as it is:
+= (text as Inform 7)
+Jarn Mound is a room.
+
+Age is a kind of value. The ages are modern, antique and ancient. A thing has
+an age. The age of a thing is usually modern.
+
+In the Mound is a Linear B tablet. The tablet is ancient. The player is wearing
+a watch.
+
+The meaning is a text that varies. The meaning is "4 oxen, 1 broken tripod table."
+
+Instead of examining the watch:
+ say "It is approximately [time of day]."
+
+Report examining the tablet:
+ say "It is [age of tablet], and translates to '[meaning]'."
+
+When play begins:
+ now the command prompt is "";
+ say "Sir Arthur Evans, hero and archeologist, invites you to explore..."
+=
In this example the C program is:
= (text as C)
@@ -406,13 +431,24 @@ int main(int argc, char **argv) {
i7process_t proc = i7_new_process();
i7_set_process_sender(&proc, NULL);
if (i7_run_process(&proc) == 0) {
+ i7val t = i7_read_variable(&proc, i7_V_the_time);
+ printf("[C program reads 'time of day' as %d]\n", t);
+ i7val A = i7_read_prop_value(&proc, i7_I_Linear_B_tablet, i7_P_age);
+ printf("[C program reads 'age of Linear B tablet' as %d]\n", A);
i7_try(&proc, i7_A_Take, i7_I_Linear_B_tablet, 0);
- i7_try(&proc, i7_A_Inv, 0, 0);
+ i7_try(&proc, i7_A_Inv, 0, 0);
+ i7_write_variable(&proc, i7_V_the_time, 985);
+ i7_try(&proc, i7_A_Examine, i7_I_watch, 0);
+ i7_write_variable(&proc, i7_V_the_time, 995);
+ i7_try(&proc, i7_A_Examine, i7_I_watch, 0);
+ i7_write_prop_value(&proc, i7_I_Linear_B_tablet, i7_P_age, i7_I_modern);
+ i7_try(&proc, i7_A_Examine, i7_I_Linear_B_tablet, 0);
+ return 0;
} else {
printf("*** Fatal error: halted ***\n");
fflush(stdout); fflush(stderr);
+ return 1;
}
- return exit_code;
}
=
Note that a header file called |inform7_symbols.h| is included. This defines
@@ -445,21 +481,56 @@ Sir Arthur Evans, hero and archeologist, invites you to explore...
Welcome
An Interactive Fiction
-Release 1 / Serial number 210918 / Inform 7 v10.1.0 / D
+Release 1 / Serial number 210919 / Inform 7 v10.1.0 / D
Jarn Mound
You can see a Linear B tablet here.
+[C program reads 'time of day' as 540]
+[C program reads 'age of Linear B tablet' as 3]
Taken.
You are carrying:
a Linear B tablet
- an iPhone
+ a watch (being worn)
+
+It is approximately 4:25 pm.
+
+It is approximately 4:35 pm.
+
+You see nothing special about the Linear B tablet.
+
+It is modern, and translates to "4 oxen, 1 broken tripod table.".
=
-Though this example doesn't use them, the following functions are also
-available:
+Here we see a run of responses, as if to unheard commands: those of course
+are the actions sent directly to the process by |i7_try|.
+
+@ Example 6 used most of the following suite of functions for looking at or
+altering the Inform data.
+
+First, some functions which can only be applied to instances of |object|:
(*) |i7_move(&proc, obj, to)| moves object |obj| to become a child of |to|;
(*) |i7_parent(&proc, obj)| returns the current parent object of |obj|;
(*) |i7_child(&proc, obj)| returns its first child;
(*) |i7_sibling(&proc, obj)| returns the next child of the same parent as |obj|.
+
+Second, functions to look at global variables:
+
+(*) |i7_read_variable(&proc, var)| returns the current value of the variable |var|;
+(*) |i7_write_variable(&proc, var, val)| sets the value to |val|.
+
+Note that where variables are created by kits such as WorldModelKit, their ID
+constants have names based on the names they have in those kits: thus |i7_V_the_time|
+refers to the time of day, not |i7_V_time_of_day|. Browsing |inform7_symbols.h|
+will usually make things clear, anyway.
+
+Finally, properties of objects can similarly be read or written:
+
+(*) |i7_read_prop_value(&proc, obj, prop)| returns the current value of property
+|prop| for the object |obj|;
+(*) |i7_write_prop_value(&proc, obj, prop, val)| sets it to |val|.
+
+If you need access to other data inside the Inform program, it's better to
+process it at the Inform end. These functions are just a convenience for what's
+most often needed.
diff --git a/inform7/runtime-module/Chapter 2/Hierarchy.w b/inform7/runtime-module/Chapter 2/Hierarchy.w
index 50c12a9f0..cd1dd899d 100644
--- a/inform7/runtime-module/Chapter 2/Hierarchy.w
+++ b/inform7/runtime-module/Chapter 2/Hierarchy.w
@@ -1808,6 +1808,7 @@ void Hierarchy::establish(void) {
@e VARIABLE_UNDERSTOOD_MD_HL
@e VARIABLE_CONTENTS_MD_HL
@e VARIABLE_DOCUMENTATION_MD_HL
+@e VARIABLE_COUNTERPART_MD_HL
@e VARIABLE_HL
@e COMMANDPROMPTTEXT_HL
@e INITIAL_MAX_SCORE_HL
@@ -1824,6 +1825,7 @@ void Hierarchy::establish(void) {
H_C_U(VARIABLE_UNDERSTOOD_MD_HL, I"^understood")
H_C_U(VARIABLE_CONTENTS_MD_HL, I"^contents")
H_C_U(VARIABLE_DOCUMENTATION_MD_HL, I"^documentation")
+ H_C_U(VARIABLE_COUNTERPART_MD_HL, I"^counterpart")
H_C_G(VARIABLE_HL, I"V")
H_F_T(COMMANDPROMPTTEXT_HL, I"command_prompt_text_fn", I"CommandPromptText")
H_C_T(INITIAL_MAX_SCORE_HL, I"INITIAL_MAX_SCORE")
diff --git a/inform7/runtime-module/Chapter 5/Variables.w b/inform7/runtime-module/Chapter 5/Variables.w
index 0613b6b23..040f9acfd 100644
--- a/inform7/runtime-module/Chapter 5/Variables.w
+++ b/inform7/runtime-module/Chapter 5/Variables.w
@@ -340,6 +340,8 @@ int RTVariables::compile(inference_subject_family *f, int ignored) {
inter_symbol *S = InterNames::to_symbol(iname);
inter_symbol *H = InterNames::to_symbol(nlv->compilation_data.lvalue_nve.iname_form);
InterSymbolsTables::equate(S, H);
+ Hierarchy::apply_metadata_from_iname(pack, VARIABLE_COUNTERPART_MD_HL,
+ nlv->compilation_data.lvalue_nve.iname_form);
}
}
@