From a1e6b9e7ab462570aaca738f60e86c3c4a6ff415 Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Mon, 10 Oct 2022 09:50:20 +0100 Subject: [PATCH] Implemented +replacing for non-functions --- README.md | 2 +- build.txt | 4 +-- .../BasicInformExtrasKit/kit_metadata.json | 2 +- .../Inter/BasicInformKit/kit_metadata.json | 2 +- .../Inter/CommandParserKit/kit_metadata.json | 2 +- .../EnglishLanguageKit/kit_metadata.json | 2 +- .../Inter/WorldModelKit/kit_metadata.json | 2 +- .../Chapter 3/Compile Splats Stage.w | 1 + notes/working_notes.md | 25 ++++++++++++++++--- 9 files changed, 31 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 136a1fb61..fd2e4cf48 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inform 7 -[Version](notes/versioning.md): 10.2.0-beta+6V80 'Krypton' (9 October 2022) +[Version](notes/versioning.md): 10.2.0-beta+6V81 'Krypton' (10 October 2022) ## About Inform diff --git a/build.txt b/build.txt index c1057110c..229159339 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ Prerelease: beta -Build Date: 9 October 2022 -Build Number: 6V80 +Build Date: 10 October 2022 +Build Number: 6V81 diff --git a/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json index 5cb18767e..367894170 100644 --- a/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformExtrasKit", - "version": "10.2.0-beta+6V80" + "version": "10.2.0-beta+6V81" }, "kit-details": { "has-priority": 1 diff --git a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json index 1fa1d12b8..10d5f6071 100644 --- a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformKit", - "version": "10.2.0-beta+6V80" + "version": "10.2.0-beta+6V81" }, "needs": [ { "unless": { diff --git a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json index 69070576b..c6b3ae655 100644 --- a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json +++ b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "CommandParserKit", - "version": "10.2.0-beta+6V80" + "version": "10.2.0-beta+6V81" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json index 459ed16e7..03fc59d3f 100644 --- a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json +++ b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "EnglishLanguageKit", - "version": "10.2.0-beta+6V80" + "version": "10.2.0-beta+6V81" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json index 7b429cda2..9d741c610 100644 --- a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json +++ b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "WorldModelKit", - "version": "10.2.0-beta+6V80" + "version": "10.2.0-beta+6V81" }, "needs": [ { "need": { diff --git a/inter/pipeline-module/Chapter 3/Compile Splats Stage.w b/inter/pipeline-module/Chapter 3/Compile Splats Stage.w index 5efdd3de2..7f0e84cb6 100644 --- a/inter/pipeline-module/Chapter 3/Compile Splats Stage.w +++ b/inter/pipeline-module/Chapter 3/Compile Splats Stage.w @@ -232,6 +232,7 @@ the result, declare a symbol for it, and then define that symbol. inter_symbol *made_s; @; + CompileSplatsStage::apply_annotations(SplatInstruction::I6_annotation(P), made_s); if ((directive == ATTRIBUTE_PLM) || (directive == PROPERTY_PLM)) @; diff --git a/notes/working_notes.md b/notes/working_notes.md index a7c53db55..8161b5443 100644 --- a/notes/working_notes.md +++ b/notes/working_notes.md @@ -37,7 +37,16 @@ implemented. So for example, placing this function in (say) `ExampleKit`... ]; ...causes it to replace the more arithmetical definition of a function with -the same name in `BasicInformKit`. Equally, source text for a project could say: +the same name in `BasicInformKit`. More specifically: + + +replacing(from BasicInformKit) [ SquareRoot num; + "Nobody cares about square roots, son."; + ]; + +replaces the definition if it occurs in `BasicInformKit` but not from anywhere +else. This all gives kits an ability to make replacements which they didn't +previously have. The same annotation can also be used in the source text for +a project: Include (- +replacing [ SquareRoot num; @@ -45,8 +54,18 @@ the same name in `BasicInformKit`. Equally, source text for a project could say: ]; -). -(Note that this use of `Include` does not end with `replacing "SquareRoot"`, -the previous best way to do this.) Either way, given something like: +This is, in a sense, not a new ability since it was already possible to write: + + Include (- + [ SquareRoot num; + "Nobody cares about square roots, son."; + ]; + -) replacing "SquareRoot". + +But the new notation allows individual definitions to be marked as replacements +and makes it much easier to make long runs of replacements. + +The effect of all of these alternatives is that given something like: When play begins: showme the square root of 100.