diff --git a/docs/core-module/13-rsfk.html b/docs/core-module/13-rsfk.html index 098acf993..89620f725 100644 --- a/docs/core-module/13-rsfk.html +++ b/docs/core-module/13-rsfk.html @@ -795,12 +795,7 @@ values for kinds, since both involve tracking constructions uniquely. kind_constructor *con = Kinds::get_construct(K); if (con->kind_GPR_iname == NULL) { package_request *R = Kinds::RunTime::package(K); - con->kind_GPR_iname = - Packaging::function( - InterNames::one_off(I"gpr_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(con->kind_GPR_iname), MAKE_NAME_UNIQUE); + con->kind_GPR_iname = Hierarchy::make_iname_in(GPR_FN_HL, R); } return con->kind_GPR_iname; } @@ -810,12 +805,7 @@ values for kinds, since both involve tracking constructions uniquely. kind_constructor *con = Kinds::get_construct(K); if (con->instance_GPR_iname == NULL) { package_request *R = Kinds::RunTime::package(K); - con->instance_GPR_iname = - Packaging::function( - InterNames::one_off(I"instance_gpr_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(con->instance_GPR_iname), MAKE_NAME_UNIQUE); + con->instance_GPR_iname = Hierarchy::make_iname_in(INSTANCE_GPR_FN_HL, R); } return con->instance_GPR_iname; } diff --git a/docs/core-module/20-eq.html b/docs/core-module/20-eq.html index dce34f88b..72e2553a0 100644 --- a/docs/core-module/20-eq.html +++ b/docs/core-module/20-eq.html @@ -232,11 +232,7 @@ either case, an equation begins here: eqn->examined_already = FALSE; package_request *PR = Hierarchy::local_package(EQUATIONS_HAP); - eqn->eqn_iname = Packaging::function( - InterNames::one_off(I"solve_fn", PR), - PR, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(eqn->eqn_iname), MAKE_NAME_UNIQUE); + eqn->eqn_iname = Hierarchy::make_iname_in(SOLVE_FN_HL, PR); wording NO = EMPTY_WORDING, NA = EMPTY_WORDING; if (anonymous == FALSE) { diff --git a/docs/core-module/21-ac.html b/docs/core-module/21-ac.html index d61ca29aa..ae8a9d74e 100644 --- a/docs/core-module/21-ac.html +++ b/docs/core-module/21-ac.html @@ -440,11 +440,7 @@ noun for it; for example, the "announcing activity". activity *av; LOOP_OVER(av, activity) { if (StackedVariables::owner_empty(av->owned_by_av) == FALSE) { - inter_name *iname = Packaging::function( - InterNames::one_off(I"stv_creator_fn", av->av_package), - av->av_package, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(iname), MAKE_NAME_UNIQUE); + inter_name *iname = Hierarchy::make_iname_in(ACTIVITY_STV_CREATOR_FN_HL, av->av_package); StackedVariables::compile_frame_creator(av->owned_by_av, iname); } } diff --git a/docs/core-module/21-rl2.html b/docs/core-module/21-rl2.html index 9e3159948..c8910442f 100644 --- a/docs/core-module/21-rl2.html +++ b/docs/core-module/21-rl2.html @@ -292,9 +292,7 @@ built (for instance, scene endings). rb->primary_name = W; rb->alternative_name = EMPTY_WORDING; rb->rb_package = R; - - rb->rb_iname = Packaging::function(InterNames::one_off(I"run_fn", rb->rb_package), rb->rb_package, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rb->rb_iname), MAKE_NAME_UNIQUE); + rb->rb_iname = Hierarchy::make_iname_in(RUN_FN_HL, rb->rb_package); rb->rule_list = Rules::Bookings::list_new(); @@ -639,13 +637,9 @@ built (for instance, scene endings). } inter_name *Rulebooks::get_stv_creator_iname(rulebook *rb) { - if (rb->stv_creator_iname == NULL) { - rb->stv_creator_iname = Packaging::function( - InterNames::one_off(I"stv_creator_fn", rb->rb_package), - rb->rb_package, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rb->stv_creator_iname), MAKE_NAME_UNIQUE); - } + if (rb->stv_creator_iname == NULL) + rb->stv_creator_iname = + Hierarchy::make_iname_in(RULEBOOK_STV_CREATOR_FN_HL, rb->rb_package); return rb->stv_creator_iname; } diff --git a/docs/core-module/22-pav.html b/docs/core-module/22-pav.html index 9a201c0d9..56fcea3e9 100644 --- a/docs/core-module/22-pav.html +++ b/docs/core-module/22-pav.html @@ -253,8 +253,7 @@ compilation.
     void Phrases::Constants::compile_default_closure(inter_name *closure_identifier, kind *K) {
         package_request *P = Kinds::RunTime::package(K);
-        inter_name *rname = Packaging::function(InterNames::one_off(I"default_closure_fn", P), P, NULL);
-        Inter::Symbols::set_flag(InterNames::to_symbol(rname), MAKE_NAME_UNIQUE);
+        inter_name *rname = Hierarchy::make_iname_in(DEFAULT_CLOSURE_FN_HL, P);
 
         <Compile the default routine 9.2>;
         <Compile the default closure 9.1>;
diff --git a/docs/core-module/27-hl.html b/docs/core-module/27-hl.html
index e442bf9f2..724e0d41e 100644
--- a/docs/core-module/27-hl.html
+++ b/docs/core-module/27-hl.html
@@ -72,6 +72,7 @@
         struct text_stream *datum_package_name;
         struct location_requirement requirements;
         struct inter_name *equates_to_iname;
+        struct inter_symbol *package_type;
         struct name_translation trans;
         MEMORY_MANAGEMENT
     } named_resource_location;
@@ -83,6 +84,7 @@
         nrl->function_package_name = NULL;
         nrl->datum_package_name = NULL;
         nrl->equates_to_iname = NULL;
+        nrl->package_type = NULL;
         nrl->trans = Translation::same();
         nrl->requirements = HierarchyLocations::blank();
         return nrl;
@@ -98,6 +100,16 @@
         return nrl;
     }
 
+    named_resource_location *HierarchyLocations::package(int id, text_stream *name, text_stream *ptype_name, location_requirement req) {
+        named_resource_location *nrl = HierarchyLocations::new();
+        nrl->access_number = id;
+        nrl->access_name = Str::duplicate(name);
+        nrl->requirements = req;
+        nrl->package_type = HierarchyLocations::ptype(ptype_name);
+        HierarchyLocations::index(nrl);
+        return nrl;
+    }
+
     named_resource_location *HierarchyLocations::make_as(int id, text_stream *name, inter_name *iname) {
         named_resource_location *nrl = HierarchyLocations::new();
         nrl->access_number = id;
@@ -212,7 +224,11 @@
             internal_error("bad nrl ID");
         named_resource_location *nrl = nrls_indexed_by_id[id];
         if (nrl->requirements.any_package_of_this_type == NULL) internal_error("NRL accessed inappropriately");
-        if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) internal_error("constant in wrong superpackage");
+        if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) {
+            LOG("AN: %S, FPN: %S\n", nrl->access_name, nrl->function_package_name);
+            LOG("Have type: $3, required: $3\n", P->eventual_type, nrl->requirements.any_package_of_this_type);
+            internal_error("constant in wrong superpackage");
+        }
         inter_name *iname = NULL;
         if (Str::len(nrl->function_package_name) > 0) {
             iname = Packaging::function_text(
@@ -237,7 +253,8 @@
         named_resource_location *nrl = nrls_indexed_by_id[id];
         if (nrl->requirements.any_package_of_this_type == NULL) internal_error("NRL accessed inappropriately");
         if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) internal_error("subpackage in wrong superpackage");
-        return Packaging::request(InterNames::one_off(nrl->access_name, P), P, nrl->requirements.any_package_of_this_type);
+        if (nrl->package_type == NULL) internal_error("package_in_package used wrongly");
+        return Packaging::request(InterNames::one_off(nrl->access_name, P), P, nrl->package_type);
     }
 
@@ -251,7 +268,7 @@

The function HierarchyLocations::synoptic_submodule is used in 27/hr (§1.2, §1.4, §1.6, §1.10, §1.12, §1.18, §1.22, §1.26, §1.28, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42).

-

The function HierarchyLocations::any_package_of_type is used in 27/hr (§1.4, §1.6, §1.8, §1.20, §1.22, §1.28, §1.30, §1.32, §1.36, §1.40, §1.42).

+

The function HierarchyLocations::any_package_of_type is used in 27/hr (§1.4, §1.6, §1.8, §1.16, §1.20, §1.22, §1.24, §1.28, §1.30, §1.32, §1.36, §1.38, §1.40, §1.42).

The function HierarchyLocations::this_package is used in 27/hr (§1.48, §5).

@@ -261,9 +278,11 @@

The function HierarchyLocations::con is used in 27/hr (§1.2, §1.4, §1.6, §1.8, §1.10, §1.12, §1.14, §1.20, §1.22, §1.26, §1.28, §1.30, §1.32, §1.34, §1.36, §1.38, §1.40, §1.42, §1.46, §1.48, §5).

+

The function HierarchyLocations::package is used in 27/hr (§1.4, §1.6).

+

The function HierarchyLocations::make_as is used in 27/hr (§5).

-

The function HierarchyLocations::func is used in 27/hr (§1.4, §1.12, §1.18, §1.22, §1.26, §1.28, §1.36, §1.38, §1.40, §1.42, §1.46).

+

The function HierarchyLocations::func is used in 27/hr (§1.4, §1.6, §1.12, §1.16, §1.18, §1.22, §1.24, §1.26, §1.28, §1.36, §1.38, §1.40, §1.42, §1.46).

The function HierarchyLocations::datum is used in 27/hr (§1.10).

diff --git a/docs/core-module/27-hr.html b/docs/core-module/27-hr.html index b1b875c69..e9e65e0cb 100644 --- a/docs/core-module/27-hr.html +++ b/docs/core-module/27-hr.html @@ -170,6 +170,7 @@ enum CHECK_RB_HL enum CARRY_OUT_RB_HL enum REPORT_RB_HL + enum ACTION_STV_CREATOR_FN_HL enum ACTIONCODING_HL enum ACTIONDATA_HL enum ACTIONHAPPENED_HL @@ -192,9 +193,10 @@ location_requirement local_actions = HierarchyLocations::local_submodule(actions); HierarchyLocations::ap(ACTIONS_HAP, local_actions, I"action", I"_action"); location_requirement in_action = HierarchyLocations::any_package_of_type(I"_action"); - HierarchyLocations::con(CHECK_RB_HL, I"check_rb", Translation::same(), in_action); - HierarchyLocations::con(CARRY_OUT_RB_HL, I"carry_out_rb", Translation::same(), in_action); - HierarchyLocations::con(REPORT_RB_HL, I"report_rb", Translation::same(), in_action); + HierarchyLocations::package(CHECK_RB_HL, I"check_rb", I"_rulebook", in_action); + HierarchyLocations::package(CARRY_OUT_RB_HL, I"carry_out_rb", I"_rulebook", in_action); + HierarchyLocations::package(REPORT_RB_HL, I"report_rb", I"_rulebook", in_action); + HierarchyLocations::func(ACTION_STV_CREATOR_FN_HL, I"stv_creator_fn", Translation::uniqued(), in_action); location_requirement synoptic_actions = HierarchyLocations::synoptic_submodule(actions); HierarchyLocations::con(ACTIONCODING_HL, I"ActionCoding", Translation::same(), synoptic_actions); @@ -218,6 +220,7 @@ enum BEFORE_RB_HL enum FOR_RB_HL enum AFTER_RB_HL + enum ACTIVITY_STV_CREATOR_FN_HL enum ACTIVITY_AFTER_RULEBOOKS_HL enum ACTIVITY_ATB_RULEBOOKS_HL enum ACTIVITY_BEFORE_RULEBOOKS_HL @@ -235,9 +238,10 @@ location_requirement local_activities = HierarchyLocations::local_submodule(activities); HierarchyLocations::ap(ACTIVITIES_HAP, local_activities, I"activity", I"_activity"); location_requirement in_activity = HierarchyLocations::any_package_of_type(I"_activity"); - HierarchyLocations::con(BEFORE_RB_HL, I"before_rb", Translation::same(), in_activity); - HierarchyLocations::con(FOR_RB_HL, I"for_rb", Translation::same(), in_activity); - HierarchyLocations::con(AFTER_RB_HL, I"after_rb", Translation::same(), in_activity); + HierarchyLocations::package(BEFORE_RB_HL, I"before_rb", I"_rulebook", in_activity); + HierarchyLocations::package(FOR_RB_HL, I"for_rb", I"_rulebook", in_activity); + HierarchyLocations::package(AFTER_RB_HL, I"after_rb", I"_rulebook", in_activity); + HierarchyLocations::func(ACTIVITY_STV_CREATOR_FN_HL, I"stv_creator_fn", Translation::uniqued(), in_activity); location_requirement synoptic_activities = HierarchyLocations::synoptic_submodule(activities); HierarchyLocations::con(ACTIVITY_AFTER_RULEBOOKS_HL, I"Activity_after_rulebooks", Translation::same(), synoptic_activities); @@ -387,6 +391,7 @@
     enum EQUATIONS_HAP
+    enum SOLVE_FN_HL
 

§1.16. <Establish equations 1.16> = @@ -398,6 +403,8 @@ location_requirement local_equations = HierarchyLocations::local_submodule(equations); HierarchyLocations::ap(EQUATIONS_HAP, local_equations, I"equation", I"_equation"); + location_requirement in_equation = HierarchyLocations::any_package_of_type(I"_equation"); + HierarchyLocations::func(SOLVE_FN_HL, I"solve_fn", Translation::uniqued(), in_equation);

@@ -546,6 +553,7 @@
     enum INSTANCES_HAP
+    enum BACKDROP_FOUND_IN_FN_HL
 

§1.24. <Establish instances 1.24> = @@ -557,6 +565,8 @@ location_requirement local_instances = HierarchyLocations::local_submodule(instances); HierarchyLocations::ap(INSTANCES_HAP, local_instances, I"instance", I"_instance"); + location_requirement in_instance = HierarchyLocations::any_package_of_type(I"_instance"); + HierarchyLocations::func(BACKDROP_FOUND_IN_FN_HL, I"backdrop_found_in_fn", Translation::uniqued(), in_instance);

@@ -621,6 +631,9 @@ enum DECREMENT_FN_HL enum INCREMENT_FN_HL enum RANGER_FN_HL + enum DEFAULT_CLOSURE_FN_HL + enum GPR_FN_HL + enum INSTANCE_GPR_FN_HL enum DEFAULTVALUEOFKOV_HL enum DEFAULTVALUEFINDER_HL enum PRINTKINDVALUEPAIR_HL @@ -654,6 +667,9 @@ HierarchyLocations::con(DECREMENT_FN_HL, I"decrement_fn", Translation::uniqued(), in_kind); HierarchyLocations::con(INCREMENT_FN_HL, I"increment_fn", Translation::uniqued(), in_kind); HierarchyLocations::con(RANGER_FN_HL, I"ranger_fn", Translation::uniqued(), in_kind); + HierarchyLocations::func(DEFAULT_CLOSURE_FN_HL, I"default_closure_fn", Translation::uniqued(), in_kind); + HierarchyLocations::func(GPR_FN_HL, I"gpr_fn", Translation::uniqued(), in_kind); + HierarchyLocations::func(INSTANCE_GPR_FN_HL, I"instance_gpr_fn", Translation::uniqued(), in_kind); location_requirement synoptic_kinds = HierarchyLocations::synoptic_submodule(kinds); HierarchyLocations::con(BASE_KIND_HWM_HL, I"BASE_KIND_HWM", Translation::same(), synoptic_kinds); @@ -785,6 +801,14 @@ enum RELATIONS_HAP enum BITMAP_HL enum ROUTE_CACHE_HL + enum HANDLER_FN_HL + enum RELATION_INITIALISER_FN_HL + enum GUARD_F0_FN_HL + enum GUARD_F1_FN_HL + enum GUARD_TEST_FN_HL + enum GUARD_MAKE_TRUE_FN_HL + enum GUARD_MAKE_FALSE_INAME_HL + enum RELATION_FN_HL enum CREATEDYNAMICRELATIONS_HL enum CCOUNT_BINARY_PREDICATE_HL enum ITERATERELATIONS_HL @@ -819,9 +843,17 @@ location_requirement local_rels = HierarchyLocations::local_submodule(relations); HierarchyLocations::ap(RELATIONS_HAP, local_rels, I"relation", I"_relation"); - location_requirement in_relation = HierarchyLocations::any_package_of_type(I"_relation"); - HierarchyLocations::con(BITMAP_HL, I"as_constant", Translation::uniqued(), in_relation); - HierarchyLocations::con(ROUTE_CACHE_HL, I"route_cache", Translation::uniqued(), in_relation); + location_requirement in_relation = HierarchyLocations::any_package_of_type(I"_relation"); + HierarchyLocations::con(BITMAP_HL, I"as_constant", Translation::uniqued(), in_relation); + HierarchyLocations::con(ROUTE_CACHE_HL, I"route_cache", Translation::uniqued(), in_relation); + HierarchyLocations::func(HANDLER_FN_HL, I"handler_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(RELATION_INITIALISER_FN_HL, I"relation_initialiser_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_F0_FN_HL, I"guard_f0_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_F1_FN_HL, I"guard_f1_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_TEST_FN_HL, I"guard_test_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_MAKE_TRUE_FN_HL, I"guard_make_true_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_MAKE_FALSE_INAME_HL, I"guard_make_false_iname", Translation::uniqued(), in_relation); + HierarchyLocations::func(RELATION_FN_HL, I"relation_fn", Translation::uniqued(), in_relation); location_requirement synoptic_rels = HierarchyLocations::synoptic_submodule(relations); HierarchyLocations::func(CREATEDYNAMICRELATIONS_HL, I"creator_fn", Translation::to(I"CreateDynamicRelations"), synoptic_rels); @@ -841,6 +873,8 @@ enum EMPTY_RULEBOOK_INAME_HL enum OUTCOMES_HAP enum RULEBOOKS_HAP + enum RUN_FN_HL + enum RULEBOOK_STV_CREATOR_FN_HL enum NUMBER_RULEBOOKS_CREATED_HL enum RULEBOOK_VAR_CREATORS_HL enum SLOW_LOOKUP_HL @@ -861,6 +895,9 @@ location_requirement local_rulebooks = HierarchyLocations::local_submodule(rulebooks); HierarchyLocations::ap(OUTCOMES_HAP, local_rulebooks, I"rulebook_outcome", I"_outcome"); HierarchyLocations::ap(RULEBOOKS_HAP, local_rulebooks, I"rulebook", I"_rulebook"); + location_requirement in_rulebook = HierarchyLocations::any_package_of_type(I"_rulebook"); + HierarchyLocations::func(RUN_FN_HL, I"run_fn", Translation::uniqued(), in_rulebook); + HierarchyLocations::func(RULEBOOK_STV_CREATOR_FN_HL, I"stv_creator_fn", Translation::uniqued(), in_rulebook); location_requirement synoptic_rulebooks = HierarchyLocations::synoptic_submodule(rulebooks); HierarchyLocations::con(NUMBER_RULEBOOKS_CREATED_HL, I"NUMBER_RULEBOOKS_CREATED", Translation::same(), synoptic_rulebooks); @@ -1701,7 +1738,7 @@

The function Hierarchy::package_within is used in 17/rs (§5), 19/tc (§9), 22/pav (§7), 22/tp (§7).

-

The function Hierarchy::make_iname_in is used in 6/rlt (§20, §20.3), 13/rsfk (§13.1.1), 17/rs (§5, §6.1), 19/tc (§9), 19/tb (§9), 21/rl (§9), 22/pav (§7), 26/lt (§3), 26/jl (§3), 26/ts (§9.1).

+

The function Hierarchy::make_iname_in is used in 6/bp (§32), 6/rlt (§9, §9.13, §20, §20.3), 13/rsfk (§13.1.1, §15), 17/rs (§5, §6.1), 19/tc (§9), 19/tb (§9), 20/eq (§10.1), 21/rl (§9), 21/rl2 (§10, §14), 21/ac (§8), 22/pav (§7, §9), 26/lt (§3), 26/jl (§3), 26/ts (§9.1).

The function Hierarchy::make_iname_with_memo appears nowhere else.

diff --git a/docs/core-module/27-in.html b/docs/core-module/27-in.html index da84b9e60..782bde329 100644 --- a/docs/core-module/27-in.html +++ b/docs/core-module/27-in.html @@ -338,11 +338,11 @@

The function InterNames::new_in_space is used in §4.

-

The function InterNames::one_off is used in 5/un (§1), 6/bp (§32), 6/rlt (§9, §9.13), 12/cdp (§5), 13/rsfk (§15), 15/pr (§27), 15/ma (§11.3), 17/tl (§14.2), 20/eq (§10.1), 21/rl (§9, §19), 21/rl2 (§10, §14), 21/fao (§10), 21/ac (§8), 22/ph (§11), 22/pu (§6), 22/pav (§9), 22/tp (§7), 24/ch (§3), 26/lt (§3), 26/rt (§4), 27/pc (§7, §7.1, §8), 27/hl (§1), 27/hr (§5).

+

The function InterNames::one_off is used in 5/un (§1), 12/cdp (§5), 15/pr (§27), 15/ma (§11.3), 17/tl (§14.2), 21/rl (§9, §19), 21/fao (§10), 22/ph (§11), 22/pu (§6), 22/tp (§7), 24/ch (§3), 26/lt (§3), 26/rt (§4), 27/pc (§7, §7.1, §8), 27/hl (§1), 27/hr (§5).

The function InterNames::attach_memo is used in §4, 5/un (§1), 5/nv (§16), 13/rsfk (§13.1.1), 15/pr (§27), 15/ep (§4), 15/vp (§3), 19/tb (§20), 21/fao (§10), 21/ac (§6), 27/hl (§1).

-

The function InterNames::to_symbol is used in §5, 4/am (§6, §43), 5/lp (§19, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1), 5/un (§1), 5/ins (§14), 5/nv (§12), 6/bp (§32, §33), 6/rlt (§9, §9.13, §15, §15.1.2, §15.1.3, §15.2.1, §15.2.5.1, §15.2.6, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §29.5, §29.6), 6/nv (§17, §18.2), 12/dtd (§4, §7.1.2, §11, §17, §27), 12/cdp (§2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §5), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.11, §1.12), 13/rsfk (§5, §7, §9, §12, §13.1.1, §15, §19, §20, §26.6.1, §26.6.2, §26.6.3, §26.6.4, §26.6.5, §26.6.6), 14/lv (§14.3, §14.4, §14.5), 14/cfs (§7), 15/pr (§21, §22.1, §27), 15/ma (§11.3), 17/tl (§7, §10.2.1, §13, §14.2), 17/ts (§5, §7, §8), 17/rs (§6.1, §6.2, §7.2), 18/lc (§11), 19/tc (§8), 19/tb (§20), 20/eq (§10.1, §48), 21/rl (§9, §11.2, §22, §22.1), 21/rb (§24.1.3.1), 21/rl2 (§10, §14), 21/fao (§10), 21/sv (§3.2), 21/ac (§8, §14), 22/prcd (§10, §10.1.1.1), 22/pav (§9, §9.2), 24/lv (§41), 24/ch (§4), 25/ci (§3.2.3.6), 25/ciac (§2), 25/cii (§3.1.1.4.7.1, §3.1.1.4.9, §3.1.1.4.10, §3.5.3, §3.5.8, §3.5.8.1), 25/cp (§6), 26/rt (§4, §4.1.2, §4.1.3, §4.1.4), 26/iti (§9), 26/ts (§10, §12), 27/is (§32), 27/ei (§3, §4, §5), 27/pc (§8), 27/hl (§1), 27/hr (§5).

+

The function InterNames::to_symbol is used in §5, 4/am (§6, §43), 5/lp (§19, §19.3.1, §19.3.1.1, §19.3.2, §19.2.1), 5/un (§1), 5/ins (§14), 5/nv (§12), 6/bp (§33), 6/rlt (§15, §15.1.2, §15.1.3, §15.2.1, §15.2.5.1, §15.2.6, §15.2.10, §15.2.11, §15.2.12, §15.2.9.1, §15.2.10.1, §15.2.12.1, §29.5, §29.6), 6/nv (§17, §18.2), 12/dtd (§4, §7.1.2, §11, §17, §27), 12/cdp (§2.1.6.1.8, §2.1.6.1.2.2.3, §2.1.6.1.9, §5), 13/ca (§1, §1.2, §1.3, §1.4, §1.5, §1.6, §1.7, §1.8, §1.9, §1.11, §1.12), 13/rsfk (§5, §7, §9, §12, §13.1.1, §19, §20, §26.6.1, §26.6.2, §26.6.3, §26.6.4, §26.6.5, §26.6.6), 14/lv (§14.3, §14.4, §14.5), 14/cfs (§7), 15/pr (§21, §22.1, §27), 15/ma (§11.3), 17/tl (§7, §10.2.1, §13, §14.2), 17/ts (§5, §7, §8), 17/rs (§6.1, §6.2, §7.2), 18/lc (§11), 19/tc (§8), 19/tb (§20), 20/eq (§48), 21/rl (§9, §11.2, §22, §22.1), 21/rb (§24.1.3.1), 21/fao (§10), 21/sv (§3.2), 21/ac (§14), 22/prcd (§10, §10.1.1.1), 22/pav (§9.2), 24/lv (§41), 24/ch (§4), 25/ci (§3.2.3.6), 25/ciac (§2), 25/cii (§3.1.1.4.7.1, §3.1.1.4.9, §3.1.1.4.10, §3.5.3, §3.5.8, §3.5.8.1), 25/cp (§6), 26/rt (§4, §4.1.2, §4.1.3, §4.1.4), 26/iti (§9), 26/ts (§10, §12), 27/is (§32), 27/ei (§3, §4, §5), 27/pc (§8), 27/hl (§1), 27/hr (§5).

The function InterNames::to_text is used in 15/vp (§3).

diff --git a/docs/core-module/27-pc.html b/docs/core-module/27-pc.html index a0a584c37..570f35220 100644 --- a/docs/core-module/27-pc.html +++ b/docs/core-module/27-pc.html @@ -500,7 +500,7 @@

The function Packaging::supply_iname is used in 4/am (§6), 6/rlt (§15.1.2), 12/dtd (§4), 13/rsfk (§19), 17/tl (§7, §10.2.1, §14.2), 17/ts (§5), 18/lc (§11), 27/ei (§4), 27/hl (§2).

-

The function Packaging::function is used in 6/bp (§32), 6/rlt (§9, §9.13), 12/dtd (§4), 13/rsfk (§15), 15/ma (§11.3), 17/tl (§14.2), 17/ts (§5), 20/eq (§10.1), 21/rl (§19), 21/rl2 (§10, §14), 21/ac (§8), 22/ph (§11), 22/pu (§6), 22/pav (§9), 22/tp (§7), 24/ch (§3), 26/lt (§3), 27/hl (§1).

+

The function Packaging::function is used in 12/dtd (§4), 15/ma (§11.3), 17/tl (§14.2), 17/ts (§5), 21/rl (§19), 22/ph (§11), 22/pu (§6), 22/tp (§7), 24/ch (§3), 26/lt (§3), 27/hl (§1).

The function Packaging::function_text is used in 21/rl (§9), 27/hl (§1).

diff --git a/docs/core-module/27-tr.html b/docs/core-module/27-tr.html index 54478db30..3cb1f14da 100644 --- a/docs/core-module/27-tr.html +++ b/docs/core-module/27-tr.html @@ -51,7 +51,7 @@

The function Translation::same is used in 27/hl (§1), 27/hr (§1.2, §1.4, §1.6, §1.10, §1.12, §1.14, §1.22, §1.26, §1.28, §1.34, §1.36, §1.38, §1.40, §1.42, §1.46, §1.48, §5).

-

The function Translation::uniqued is used in 27/hr (§1.8, §1.20, §1.22, §1.28, §1.30, §1.32, §1.36, §1.40, §1.42).

+

The function Translation::uniqued is used in 27/hr (§1.4, §1.6, §1.8, §1.16, §1.20, §1.22, §1.24, §1.28, §1.30, §1.32, §1.36, §1.38, §1.40, §1.42).

The function Translation::to is used in 27/hr (§1.4, §1.10, §1.12, §1.18, §1.22, §1.26, §1.28, §1.36, §1.38, §1.40, §1.42, §1.46).

diff --git a/docs/core-module/6-bp.html b/docs/core-module/6-bp.html index 6bcb75065..82c36a3e3 100644 --- a/docs/core-module/6-bp.html +++ b/docs/core-module/6-bp.html @@ -842,8 +842,7 @@ would always be NULL i inter_name *BinaryPredicates::handler_iname(binary_predicate *bp) { if (bp->handler_iname == NULL) { package_request *R = BinaryPredicates::package(bp); - bp->handler_iname = Packaging::function(InterNames::one_off(I"handler_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(bp->handler_iname), MAKE_NAME_UNIQUE); + bp->handler_iname = Hierarchy::make_iname_in(HANDLER_FN_HL, R); } return bp->handler_iname; } diff --git a/docs/core-module/6-rlt.html b/docs/core-module/6-rlt.html index 8f80a7e99..0b874df12 100644 --- a/docs/core-module/6-rlt.html +++ b/docs/core-module/6-rlt.html @@ -279,8 +279,7 @@ splitting into cases. bp->dynamic_memory = TRUE; bpr->dynamic_memory = TRUE; package_request *P = BinaryPredicates::package(bp); - bp->initialiser_iname = Packaging::function(InterNames::one_off(I"relation_initialiser_fn", P), P, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(bp->initialiser_iname), MAKE_NAME_UNIQUE); + bp->initialiser_iname = Hierarchy::make_iname_in(RELATION_INITIALISER_FN_HL, P); } BinaryPredicates::mark_as_needed(bp); @@ -325,34 +324,29 @@ splitting into cases. rg->guard_make_false_iname = NULL; if (rg->f0) { package_request *R = BinaryPredicates::package(bp); - rg->guard_f0_iname = Packaging::function(InterNames::one_off(I"guard_f0_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_f0_iname), MAKE_NAME_UNIQUE); + rg->guard_f0_iname = Hierarchy::make_iname_in(GUARD_F0_FN_HL, R); BinaryPredicates::set_term_function(&(bp->term_details[0]), Calculus::Schemas::new("(%n(*1))", rg->guard_f0_iname)); } if (rg->f1) { package_request *R = BinaryPredicates::package(bp); - rg->guard_f1_iname = Packaging::function(InterNames::one_off(I"guard_f1_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_f1_iname), MAKE_NAME_UNIQUE); + rg->guard_f1_iname = Hierarchy::make_iname_in(GUARD_F1_FN_HL, R); BinaryPredicates::set_term_function(&(bp->term_details[1]), Calculus::Schemas::new("(%n(*1))", rg->guard_f1_iname)); } if (bp->test_function) { package_request *R = BinaryPredicates::package(bp); - rg->guard_test_iname = Packaging::function(InterNames::one_off(I"guard_test_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_test_iname), MAKE_NAME_UNIQUE); + rg->guard_test_iname = Hierarchy::make_iname_in(GUARD_TEST_FN_HL, R); bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_test_iname); } if (bp->make_true_function) { package_request *R = BinaryPredicates::package(bp); - rg->guard_make_true_iname = Packaging::function(InterNames::one_off(I"guard_make_true_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_make_true_iname), MAKE_NAME_UNIQUE); + rg->guard_make_true_iname = Hierarchy::make_iname_in(GUARD_MAKE_TRUE_FN_HL, R); bp->make_true_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_true_iname); } if (bp->make_false_function) { package_request *R = BinaryPredicates::package(bp); - rg->guard_make_false_iname = Packaging::function(InterNames::one_off(I"guard_make_false_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_make_false_iname), MAKE_NAME_UNIQUE); + rg->guard_make_false_iname = Hierarchy::make_iname_in(GUARD_MAKE_FALSE_INAME_HL, R); bp->make_false_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_false_iname); } } @@ -1034,8 +1028,7 @@ logical properties of the two terms of the BP being defined.
             bp->form_of_relation = Relation_ByRoutine;
             package_request *P = BinaryPredicates::package(bp);
-            bp->bp_by_routine_iname = Packaging::function(InterNames::one_off(I"relation_fn", P), P, NULL);
-            Inter::Symbols::set_flag(InterNames::to_symbol(bp->bp_by_routine_iname), MAKE_NAME_UNIQUE);
+            bp->bp_by_routine_iname = Hierarchy::make_iname_in(RELATION_FN_HL, P);
             bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", bp->bp_by_routine_iname);
             bp->condition_defn_text = CONW;
     
@@ -1403,8 +1396,8 @@ logical properties of the two terms of the BP being defined. binary_predicate *dbp = bp; if (bp->right_way_round == FALSE) dbp = bp->reversal; inter_name *bm_symb = Packaging::supply_iname(bp->bp_package, MISC_PR_COUNTER); - Emit::sum_constant_begin(bm_symb, K_value); Inter::Symbols::set_flag(InterNames::to_symbol(bm_symb), MAKE_NAME_UNIQUE); + Emit::sum_constant_begin(bm_symb, K_value); if (RELS_TEST_iname == NULL) internal_error("no RELS symbols yet"); Emit::array_iname_entry(RELS_TEST_iname); if (minimal == FALSE) { diff --git a/docs/if-module/3-bck.html b/docs/if-module/3-bck.html index 38bd409a5..7c368bd89 100644 --- a/docs/if-module/3-bck.html +++ b/docs/if-module/3-bck.html @@ -465,14 +465,7 @@ been asserted true: backdrop_found_in_notice *notice = CREATE(backdrop_found_in_notice); notice->backdrop = I; package_request *R = Instances::package(I); - notice->found_in_routine_iname = - Packaging::function( - InterNames::one_off(I"backdrop_found_in_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(notice->found_in_routine_iname), - MAKE_NAME_UNIQUE); - InterNames::to_symbol(notice->found_in_routine_iname); + notice->found_in_routine_iname = Hierarchy::make_iname_in(BACKDROP_FOUND_IN_FN_HL, R); notice->many_places = TRUE; FOUNDIN = notice->found_in_routine_iname; @@ -497,13 +490,7 @@ code, derived from the old I6 library, requires backdrop_found_in_notice *notice = CREATE(backdrop_found_in_notice); notice->backdrop = I; package_request *R = Instances::package(I); - notice->found_in_routine_iname = - Packaging::function( - InterNames::one_off(I"backdrop_found_in_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(notice->found_in_routine_iname), - MAKE_NAME_UNIQUE); + notice->found_in_routine_iname = Hierarchy::make_iname_in(BACKDROP_FOUND_IN_FN_HL, R); InterNames::to_symbol(notice->found_in_routine_iname); notice->many_places = FALSE; FOUNDIN = notice->found_in_routine_iname; diff --git a/docs/if-module/4-act.html b/docs/if-module/4-act.html index 62c8310e3..40c0fe1c1 100644 --- a/docs/if-module/4-act.html +++ b/docs/if-module/4-act.html @@ -905,12 +905,8 @@ action patterns. For example, the Standard Rules define: action_name *an; LOOP_OVER(an, action_name) { if ((an->owned_by_an) && - (StackedVariables::owner_empty(an->owned_by_an) == FALSE)) { - inter_name *iname = Packaging::function( - InterNames::one_off(I"stv_creator_fn", an->an_package), - an->an_package, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(iname), MAKE_NAME_UNIQUE); + (StackedVariables::owner_empty(an->owned_by_an) == FALSE)) { + inter_name *iname = Hierarchy::make_iname_in(ACTION_STV_CREATOR_FN_HL, an->an_package); StackedVariables::compile_frame_creator(an->owned_by_an, iname); } } diff --git a/inform7/core-module/Chapter 13/Runtime Support for Kinds.w b/inform7/core-module/Chapter 13/Runtime Support for Kinds.w index afd8d9a73..edae405a4 100644 --- a/inform7/core-module/Chapter 13/Runtime Support for Kinds.w +++ b/inform7/core-module/Chapter 13/Runtime Support for Kinds.w @@ -616,12 +616,7 @@ inter_name *Kinds::RunTime::get_kind_GPR_iname(kind *K) { kind_constructor *con = Kinds::get_construct(K); if (con->kind_GPR_iname == NULL) { package_request *R = Kinds::RunTime::package(K); - con->kind_GPR_iname = - Packaging::function( - InterNames::one_off(I"gpr_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(con->kind_GPR_iname), MAKE_NAME_UNIQUE); + con->kind_GPR_iname = Hierarchy::make_iname_in(GPR_FN_HL, R); } return con->kind_GPR_iname; } @@ -631,12 +626,7 @@ inter_name *Kinds::RunTime::get_instance_GPR_iname(kind *K) { kind_constructor *con = Kinds::get_construct(K); if (con->instance_GPR_iname == NULL) { package_request *R = Kinds::RunTime::package(K); - con->instance_GPR_iname = - Packaging::function( - InterNames::one_off(I"instance_gpr_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(con->instance_GPR_iname), MAKE_NAME_UNIQUE); + con->instance_GPR_iname = Hierarchy::make_iname_in(INSTANCE_GPR_FN_HL, R); } return con->instance_GPR_iname; } diff --git a/inform7/core-module/Chapter 20/Equations.w b/inform7/core-module/Chapter 20/Equations.w index 75c2c2aa4..ad4843cef 100644 --- a/inform7/core-module/Chapter 20/Equations.w +++ b/inform7/core-module/Chapter 20/Equations.w @@ -161,11 +161,7 @@ equation *Equations::new(wording W, int anonymous) { eqn->examined_already = FALSE; package_request *PR = Hierarchy::local_package(EQUATIONS_HAP); - eqn->eqn_iname = Packaging::function( - InterNames::one_off(I"solve_fn", PR), - PR, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(eqn->eqn_iname), MAKE_NAME_UNIQUE); + eqn->eqn_iname = Hierarchy::make_iname_in(SOLVE_FN_HL, PR); wording NO = EMPTY_WORDING, NA = EMPTY_WORDING; if (anonymous == FALSE) { diff --git a/inform7/core-module/Chapter 21/Activities.w b/inform7/core-module/Chapter 21/Activities.w index 7c30b2c4e..073c765e9 100644 --- a/inform7/core-module/Chapter 21/Activities.w +++ b/inform7/core-module/Chapter 21/Activities.w @@ -362,11 +362,7 @@ void Activities::activity_var_creators(void) { activity *av; LOOP_OVER(av, activity) { if (StackedVariables::owner_empty(av->owned_by_av) == FALSE) { - inter_name *iname = Packaging::function( - InterNames::one_off(I"stv_creator_fn", av->av_package), - av->av_package, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(iname), MAKE_NAME_UNIQUE); + inter_name *iname = Hierarchy::make_iname_in(ACTIVITY_STV_CREATOR_FN_HL, av->av_package); StackedVariables::compile_frame_creator(av->owned_by_av, iname); } } diff --git a/inform7/core-module/Chapter 21/Rulebooks.w b/inform7/core-module/Chapter 21/Rulebooks.w index e4719eada..74ebaf055 100644 --- a/inform7/core-module/Chapter 21/Rulebooks.w +++ b/inform7/core-module/Chapter 21/Rulebooks.w @@ -214,9 +214,7 @@ rulebook *Rulebooks::new(kind *create_as, wording W, package_request *R) { rb->primary_name = W; rb->alternative_name = EMPTY_WORDING; rb->rb_package = R; - - rb->rb_iname = Packaging::function(InterNames::one_off(I"run_fn", rb->rb_package), rb->rb_package, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rb->rb_iname), MAKE_NAME_UNIQUE); + rb->rb_iname = Hierarchy::make_iname_in(RUN_FN_HL, rb->rb_package); rb->rule_list = Rules::Bookings::list_new(); @@ -495,13 +493,9 @@ void Rulebooks::make_stvs_accessible(rulebook *rb, stacked_variable_owner *stvo) } inter_name *Rulebooks::get_stv_creator_iname(rulebook *rb) { - if (rb->stv_creator_iname == NULL) { - rb->stv_creator_iname = Packaging::function( - InterNames::one_off(I"stv_creator_fn", rb->rb_package), - rb->rb_package, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rb->stv_creator_iname), MAKE_NAME_UNIQUE); - } + if (rb->stv_creator_iname == NULL) + rb->stv_creator_iname = + Hierarchy::make_iname_in(RULEBOOK_STV_CREATOR_FN_HL, rb->rb_package); return rb->stv_creator_iname; } diff --git a/inform7/core-module/Chapter 22/Phrases as Values.w b/inform7/core-module/Chapter 22/Phrases as Values.w index e2a9ebf26..cff0e60b4 100644 --- a/inform7/core-module/Chapter 22/Phrases as Values.w +++ b/inform7/core-module/Chapter 22/Phrases as Values.w @@ -167,8 +167,7 @@ compilation. = void Phrases::Constants::compile_default_closure(inter_name *closure_identifier, kind *K) { package_request *P = Kinds::RunTime::package(K); - inter_name *rname = Packaging::function(InterNames::one_off(I"default_closure_fn", P), P, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rname), MAKE_NAME_UNIQUE); + inter_name *rname = Hierarchy::make_iname_in(DEFAULT_CLOSURE_FN_HL, P); @; @; diff --git a/inform7/core-module/Chapter 27/Hierarchy Locations.w b/inform7/core-module/Chapter 27/Hierarchy Locations.w index 632d1399d..ffa1302f5 100644 --- a/inform7/core-module/Chapter 27/Hierarchy Locations.w +++ b/inform7/core-module/Chapter 27/Hierarchy Locations.w @@ -62,6 +62,7 @@ typedef struct named_resource_location { struct text_stream *datum_package_name; struct location_requirement requirements; struct inter_name *equates_to_iname; + struct inter_symbol *package_type; struct name_translation trans; MEMORY_MANAGEMENT } named_resource_location; @@ -73,6 +74,7 @@ named_resource_location *HierarchyLocations::new(void) { nrl->function_package_name = NULL; nrl->datum_package_name = NULL; nrl->equates_to_iname = NULL; + nrl->package_type = NULL; nrl->trans = Translation::same(); nrl->requirements = HierarchyLocations::blank(); return nrl; @@ -88,6 +90,16 @@ named_resource_location *HierarchyLocations::con(int id, text_stream *name, name return nrl; } +named_resource_location *HierarchyLocations::package(int id, text_stream *name, text_stream *ptype_name, location_requirement req) { + named_resource_location *nrl = HierarchyLocations::new(); + nrl->access_number = id; + nrl->access_name = Str::duplicate(name); + nrl->requirements = req; + nrl->package_type = HierarchyLocations::ptype(ptype_name); + HierarchyLocations::index(nrl); + return nrl; +} + named_resource_location *HierarchyLocations::make_as(int id, text_stream *name, inter_name *iname) { named_resource_location *nrl = HierarchyLocations::new(); nrl->access_number = id; @@ -202,7 +214,11 @@ inter_name *HierarchyLocations::find_in_package(int id, package_request *P, word internal_error("bad nrl ID"); named_resource_location *nrl = nrls_indexed_by_id[id]; if (nrl->requirements.any_package_of_this_type == NULL) internal_error("NRL accessed inappropriately"); - if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) internal_error("constant in wrong superpackage"); + if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) { + LOG("AN: %S, FPN: %S\n", nrl->access_name, nrl->function_package_name); + LOG("Have type: $3, required: $3\n", P->eventual_type, nrl->requirements.any_package_of_this_type); + internal_error("constant in wrong superpackage"); + } inter_name *iname = NULL; if (Str::len(nrl->function_package_name) > 0) { iname = Packaging::function_text( @@ -227,7 +243,8 @@ package_request *HierarchyLocations::package_in_package(int id, package_request named_resource_location *nrl = nrls_indexed_by_id[id]; if (nrl->requirements.any_package_of_this_type == NULL) internal_error("NRL accessed inappropriately"); if ((P == NULL) || (P->eventual_type != nrl->requirements.any_package_of_this_type)) internal_error("subpackage in wrong superpackage"); - return Packaging::request(InterNames::one_off(nrl->access_name, P), P, nrl->requirements.any_package_of_this_type); + if (nrl->package_type == NULL) internal_error("package_in_package used wrongly"); + return Packaging::request(InterNames::one_off(nrl->access_name, P), P, nrl->package_type); } @ diff --git a/inform7/core-module/Chapter 27/Hierarchy.w b/inform7/core-module/Chapter 27/Hierarchy.w index a2b07c8a9..969827c35 100644 --- a/inform7/core-module/Chapter 27/Hierarchy.w +++ b/inform7/core-module/Chapter 27/Hierarchy.w @@ -141,6 +141,7 @@ void Hierarchy::establish(void) { @e CHECK_RB_HL @e CARRY_OUT_RB_HL @e REPORT_RB_HL +@e ACTION_STV_CREATOR_FN_HL @e ACTIONCODING_HL @e ACTIONDATA_HL @@ -159,9 +160,10 @@ void Hierarchy::establish(void) { location_requirement local_actions = HierarchyLocations::local_submodule(actions); HierarchyLocations::ap(ACTIONS_HAP, local_actions, I"action", I"_action"); location_requirement in_action = HierarchyLocations::any_package_of_type(I"_action"); - HierarchyLocations::con(CHECK_RB_HL, I"check_rb", Translation::same(), in_action); - HierarchyLocations::con(CARRY_OUT_RB_HL, I"carry_out_rb", Translation::same(), in_action); - HierarchyLocations::con(REPORT_RB_HL, I"report_rb", Translation::same(), in_action); + HierarchyLocations::package(CHECK_RB_HL, I"check_rb", I"_rulebook", in_action); + HierarchyLocations::package(CARRY_OUT_RB_HL, I"carry_out_rb", I"_rulebook", in_action); + HierarchyLocations::package(REPORT_RB_HL, I"report_rb", I"_rulebook", in_action); + HierarchyLocations::func(ACTION_STV_CREATOR_FN_HL, I"stv_creator_fn", Translation::uniqued(), in_action); location_requirement synoptic_actions = HierarchyLocations::synoptic_submodule(actions); HierarchyLocations::con(ACTIONCODING_HL, I"ActionCoding", Translation::same(), synoptic_actions); @@ -178,6 +180,7 @@ void Hierarchy::establish(void) { @e BEFORE_RB_HL @e FOR_RB_HL @e AFTER_RB_HL +@e ACTIVITY_STV_CREATOR_FN_HL @e ACTIVITY_AFTER_RULEBOOKS_HL @e ACTIVITY_ATB_RULEBOOKS_HL @@ -191,9 +194,10 @@ void Hierarchy::establish(void) { location_requirement local_activities = HierarchyLocations::local_submodule(activities); HierarchyLocations::ap(ACTIVITIES_HAP, local_activities, I"activity", I"_activity"); location_requirement in_activity = HierarchyLocations::any_package_of_type(I"_activity"); - HierarchyLocations::con(BEFORE_RB_HL, I"before_rb", Translation::same(), in_activity); - HierarchyLocations::con(FOR_RB_HL, I"for_rb", Translation::same(), in_activity); - HierarchyLocations::con(AFTER_RB_HL, I"after_rb", Translation::same(), in_activity); + HierarchyLocations::package(BEFORE_RB_HL, I"before_rb", I"_rulebook", in_activity); + HierarchyLocations::package(FOR_RB_HL, I"for_rb", I"_rulebook", in_activity); + HierarchyLocations::package(AFTER_RB_HL, I"after_rb", I"_rulebook", in_activity); + HierarchyLocations::func(ACTIVITY_STV_CREATOR_FN_HL, I"stv_creator_fn", Translation::uniqued(), in_activity); location_requirement synoptic_activities = HierarchyLocations::synoptic_submodule(activities); HierarchyLocations::con(ACTIVITY_AFTER_RULEBOOKS_HL, I"Activity_after_rulebooks", Translation::same(), synoptic_activities); @@ -290,13 +294,16 @@ void Hierarchy::establish(void) { @h Equations. @e EQUATIONS_HAP +@e SOLVE_FN_HL @ = submodule_identity *equations = Packaging::register_submodule(I"equations"); location_requirement local_equations = HierarchyLocations::local_submodule(equations); HierarchyLocations::ap(EQUATIONS_HAP, local_equations, I"equation", I"_equation"); - + location_requirement in_equation = HierarchyLocations::any_package_of_type(I"_equation"); + HierarchyLocations::func(SOLVE_FN_HL, I"solve_fn", Translation::uniqued(), in_equation); + @h Extensions. @e SHOWEXTENSIONVERSIONS_HL @@ -402,12 +409,15 @@ void Hierarchy::establish(void) { @h Instances. @e INSTANCES_HAP +@e BACKDROP_FOUND_IN_FN_HL @ = submodule_identity *instances = Packaging::register_submodule(I"instances"); location_requirement local_instances = HierarchyLocations::local_submodule(instances); HierarchyLocations::ap(INSTANCES_HAP, local_instances, I"instance", I"_instance"); + location_requirement in_instance = HierarchyLocations::any_package_of_type(I"_instance"); + HierarchyLocations::func(BACKDROP_FOUND_IN_FN_HL, I"backdrop_found_in_fn", Translation::uniqued(), in_instance); @h Interactive Fiction. @@ -454,6 +464,9 @@ void Hierarchy::establish(void) { @e DECREMENT_FN_HL @e INCREMENT_FN_HL @e RANGER_FN_HL +@e DEFAULT_CLOSURE_FN_HL +@e GPR_FN_HL +@e INSTANCE_GPR_FN_HL @e DEFAULTVALUEOFKOV_HL @e DEFAULTVALUEFINDER_HL @@ -483,6 +496,9 @@ void Hierarchy::establish(void) { HierarchyLocations::con(DECREMENT_FN_HL, I"decrement_fn", Translation::uniqued(), in_kind); HierarchyLocations::con(INCREMENT_FN_HL, I"increment_fn", Translation::uniqued(), in_kind); HierarchyLocations::con(RANGER_FN_HL, I"ranger_fn", Translation::uniqued(), in_kind); + HierarchyLocations::func(DEFAULT_CLOSURE_FN_HL, I"default_closure_fn", Translation::uniqued(), in_kind); + HierarchyLocations::func(GPR_FN_HL, I"gpr_fn", Translation::uniqued(), in_kind); + HierarchyLocations::func(INSTANCE_GPR_FN_HL, I"instance_gpr_fn", Translation::uniqued(), in_kind); location_requirement synoptic_kinds = HierarchyLocations::synoptic_submodule(kinds); HierarchyLocations::con(BASE_KIND_HWM_HL, I"BASE_KIND_HWM", Translation::same(), synoptic_kinds); @@ -573,6 +589,14 @@ void Hierarchy::establish(void) { @e RELATIONS_HAP @e BITMAP_HL @e ROUTE_CACHE_HL +@e HANDLER_FN_HL +@e RELATION_INITIALISER_FN_HL +@e GUARD_F0_FN_HL +@e GUARD_F1_FN_HL +@e GUARD_TEST_FN_HL +@e GUARD_MAKE_TRUE_FN_HL +@e GUARD_MAKE_FALSE_INAME_HL +@e RELATION_FN_HL @e CREATEDYNAMICRELATIONS_HL @e CCOUNT_BINARY_PREDICATE_HL @@ -603,9 +627,17 @@ void Hierarchy::establish(void) { location_requirement local_rels = HierarchyLocations::local_submodule(relations); HierarchyLocations::ap(RELATIONS_HAP, local_rels, I"relation", I"_relation"); - location_requirement in_relation = HierarchyLocations::any_package_of_type(I"_relation"); - HierarchyLocations::con(BITMAP_HL, I"as_constant", Translation::uniqued(), in_relation); - HierarchyLocations::con(ROUTE_CACHE_HL, I"route_cache", Translation::uniqued(), in_relation); + location_requirement in_relation = HierarchyLocations::any_package_of_type(I"_relation"); + HierarchyLocations::con(BITMAP_HL, I"as_constant", Translation::uniqued(), in_relation); + HierarchyLocations::con(ROUTE_CACHE_HL, I"route_cache", Translation::uniqued(), in_relation); + HierarchyLocations::func(HANDLER_FN_HL, I"handler_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(RELATION_INITIALISER_FN_HL, I"relation_initialiser_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_F0_FN_HL, I"guard_f0_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_F1_FN_HL, I"guard_f1_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_TEST_FN_HL, I"guard_test_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_MAKE_TRUE_FN_HL, I"guard_make_true_fn", Translation::uniqued(), in_relation); + HierarchyLocations::func(GUARD_MAKE_FALSE_INAME_HL, I"guard_make_false_iname", Translation::uniqued(), in_relation); + HierarchyLocations::func(RELATION_FN_HL, I"relation_fn", Translation::uniqued(), in_relation); location_requirement synoptic_rels = HierarchyLocations::synoptic_submodule(relations); HierarchyLocations::func(CREATEDYNAMICRELATIONS_HL, I"creator_fn", Translation::to(I"CreateDynamicRelations"), synoptic_rels); @@ -619,6 +651,8 @@ void Hierarchy::establish(void) { @e OUTCOMES_HAP @e RULEBOOKS_HAP +@e RUN_FN_HL +@e RULEBOOK_STV_CREATOR_FN_HL @e NUMBER_RULEBOOKS_CREATED_HL @e RULEBOOK_VAR_CREATORS_HL @@ -635,6 +669,9 @@ void Hierarchy::establish(void) { location_requirement local_rulebooks = HierarchyLocations::local_submodule(rulebooks); HierarchyLocations::ap(OUTCOMES_HAP, local_rulebooks, I"rulebook_outcome", I"_outcome"); HierarchyLocations::ap(RULEBOOKS_HAP, local_rulebooks, I"rulebook", I"_rulebook"); + location_requirement in_rulebook = HierarchyLocations::any_package_of_type(I"_rulebook"); + HierarchyLocations::func(RUN_FN_HL, I"run_fn", Translation::uniqued(), in_rulebook); + HierarchyLocations::func(RULEBOOK_STV_CREATOR_FN_HL, I"stv_creator_fn", Translation::uniqued(), in_rulebook); location_requirement synoptic_rulebooks = HierarchyLocations::synoptic_submodule(rulebooks); HierarchyLocations::con(NUMBER_RULEBOOKS_CREATED_HL, I"NUMBER_RULEBOOKS_CREATED", Translation::same(), synoptic_rulebooks); diff --git a/inform7/core-module/Chapter 6/Binary Predicates.w b/inform7/core-module/Chapter 6/Binary Predicates.w index 21eed18b8..3de9101ee 100644 --- a/inform7/core-module/Chapter 6/Binary Predicates.w +++ b/inform7/core-module/Chapter 6/Binary Predicates.w @@ -629,8 +629,7 @@ package_request *BinaryPredicates::package(binary_predicate *bp) { inter_name *BinaryPredicates::handler_iname(binary_predicate *bp) { if (bp->handler_iname == NULL) { package_request *R = BinaryPredicates::package(bp); - bp->handler_iname = Packaging::function(InterNames::one_off(I"handler_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(bp->handler_iname), MAKE_NAME_UNIQUE); + bp->handler_iname = Hierarchy::make_iname_in(HANDLER_FN_HL, R); } return bp->handler_iname; } diff --git a/inform7/core-module/Chapter 6/Relations.w b/inform7/core-module/Chapter 6/Relations.w index 6cca4299e..16add4ae8 100644 --- a/inform7/core-module/Chapter 6/Relations.w +++ b/inform7/core-module/Chapter 6/Relations.w @@ -214,8 +214,7 @@ void Relations::parse_new_relation_further(parse_node *PN) { bp->dynamic_memory = TRUE; bpr->dynamic_memory = TRUE; package_request *P = BinaryPredicates::package(bp); - bp->initialiser_iname = Packaging::function(InterNames::one_off(I"relation_initialiser_fn", P), P, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(bp->initialiser_iname), MAKE_NAME_UNIQUE); + bp->initialiser_iname = Hierarchy::make_iname_in(RELATION_INITIALISER_FN_HL, P); } BinaryPredicates::mark_as_needed(bp); @@ -260,34 +259,29 @@ void Relations::parse_new_relation_further(parse_node *PN) { rg->guard_make_false_iname = NULL; if (rg->f0) { package_request *R = BinaryPredicates::package(bp); - rg->guard_f0_iname = Packaging::function(InterNames::one_off(I"guard_f0_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_f0_iname), MAKE_NAME_UNIQUE); + rg->guard_f0_iname = Hierarchy::make_iname_in(GUARD_F0_FN_HL, R); BinaryPredicates::set_term_function(&(bp->term_details[0]), Calculus::Schemas::new("(%n(*1))", rg->guard_f0_iname)); } if (rg->f1) { package_request *R = BinaryPredicates::package(bp); - rg->guard_f1_iname = Packaging::function(InterNames::one_off(I"guard_f1_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_f1_iname), MAKE_NAME_UNIQUE); + rg->guard_f1_iname = Hierarchy::make_iname_in(GUARD_F1_FN_HL, R); BinaryPredicates::set_term_function(&(bp->term_details[1]), Calculus::Schemas::new("(%n(*1))", rg->guard_f1_iname)); } if (bp->test_function) { package_request *R = BinaryPredicates::package(bp); - rg->guard_test_iname = Packaging::function(InterNames::one_off(I"guard_test_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_test_iname), MAKE_NAME_UNIQUE); + rg->guard_test_iname = Hierarchy::make_iname_in(GUARD_TEST_FN_HL, R); bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_test_iname); } if (bp->make_true_function) { package_request *R = BinaryPredicates::package(bp); - rg->guard_make_true_iname = Packaging::function(InterNames::one_off(I"guard_make_true_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_make_true_iname), MAKE_NAME_UNIQUE); + rg->guard_make_true_iname = Hierarchy::make_iname_in(GUARD_MAKE_TRUE_FN_HL, R); bp->make_true_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_true_iname); } if (bp->make_false_function) { package_request *R = BinaryPredicates::package(bp); - rg->guard_make_false_iname = Packaging::function(InterNames::one_off(I"guard_make_false_fn", R), R, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(rg->guard_make_false_iname), MAKE_NAME_UNIQUE); + rg->guard_make_false_iname = Hierarchy::make_iname_in(GUARD_MAKE_FALSE_INAME_HL, R); bp->make_false_function = Calculus::Schemas::new("(%n(*1,*2))", rg->guard_make_false_iname); } } @@ -734,8 +728,7 @@ K to L when (some condition)". @ = bp->form_of_relation = Relation_ByRoutine; package_request *P = BinaryPredicates::package(bp); - bp->bp_by_routine_iname = Packaging::function(InterNames::one_off(I"relation_fn", P), P, NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(bp->bp_by_routine_iname), MAKE_NAME_UNIQUE); + bp->bp_by_routine_iname = Hierarchy::make_iname_in(RELATION_FN_HL, P); bp->test_function = Calculus::Schemas::new("(%n(*1,*2))", bp->bp_by_routine_iname); bp->condition_defn_text = CONW; @@ -1015,8 +1008,8 @@ void Relations::compile_relation_records(void) { binary_predicate *dbp = bp; if (bp->right_way_round == FALSE) dbp = bp->reversal; inter_name *bm_symb = Packaging::supply_iname(bp->bp_package, MISC_PR_COUNTER); - Emit::sum_constant_begin(bm_symb, K_value); Inter::Symbols::set_flag(InterNames::to_symbol(bm_symb), MAKE_NAME_UNIQUE); + Emit::sum_constant_begin(bm_symb, K_value); if (RELS_TEST_iname == NULL) internal_error("no RELS symbols yet"); Emit::array_iname_entry(RELS_TEST_iname); if (minimal == FALSE) { diff --git a/inform7/if-module/Chapter 3/Backdrops.w b/inform7/if-module/Chapter 3/Backdrops.w index 057d5f083..8e46026d1 100644 --- a/inform7/if-module/Chapter 3/Backdrops.w +++ b/inform7/if-module/Chapter 3/Backdrops.w @@ -287,14 +287,7 @@ int PL::Backdrops::backdrops_complete_model(int stage) { backdrop_found_in_notice *notice = CREATE(backdrop_found_in_notice); notice->backdrop = I; package_request *R = Instances::package(I); - notice->found_in_routine_iname = - Packaging::function( - InterNames::one_off(I"backdrop_found_in_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(notice->found_in_routine_iname), - MAKE_NAME_UNIQUE); - InterNames::to_symbol(notice->found_in_routine_iname); + notice->found_in_routine_iname = Hierarchy::make_iname_in(BACKDROP_FOUND_IN_FN_HL, R); notice->many_places = TRUE; FOUNDIN = notice->found_in_routine_iname; @@ -307,13 +300,7 @@ code, derived from the old I6 library, requires |absent| to be set. So: backdrop_found_in_notice *notice = CREATE(backdrop_found_in_notice); notice->backdrop = I; package_request *R = Instances::package(I); - notice->found_in_routine_iname = - Packaging::function( - InterNames::one_off(I"backdrop_found_in_fn", R), - R, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(notice->found_in_routine_iname), - MAKE_NAME_UNIQUE); + notice->found_in_routine_iname = Hierarchy::make_iname_in(BACKDROP_FOUND_IN_FN_HL, R); InterNames::to_symbol(notice->found_in_routine_iname); notice->many_places = FALSE; FOUNDIN = notice->found_in_routine_iname; diff --git a/inform7/if-module/Chapter 4/Actions.w b/inform7/if-module/Chapter 4/Actions.w index 7779d6407..f763c9184 100644 --- a/inform7/if-module/Chapter 4/Actions.w +++ b/inform7/if-module/Chapter 4/Actions.w @@ -692,12 +692,8 @@ void PL::Actions::compile_action_name_var_creators(void) { action_name *an; LOOP_OVER(an, action_name) { if ((an->owned_by_an) && - (StackedVariables::owner_empty(an->owned_by_an) == FALSE)) { - inter_name *iname = Packaging::function( - InterNames::one_off(I"stv_creator_fn", an->an_package), - an->an_package, - NULL); - Inter::Symbols::set_flag(InterNames::to_symbol(iname), MAKE_NAME_UNIQUE); + (StackedVariables::owner_empty(an->owned_by_an) == FALSE)) { + inter_name *iname = Hierarchy::make_iname_in(ACTION_STV_CREATOR_FN_HL, an->an_package); StackedVariables::compile_frame_creator(an->owned_by_an, iname); } }