I suppose the game author could just write their own “To do whatever” phrase in the source, which looks like it automatically overwrites the original. That might actually be easier than replacing a named rule.
Hmm. Ok. Then it seems like it’s either “convert newly defined phrases to rules (with names)” or “leave game authors to their own devices when it comes to modifying defined phrases.”
It depends on what the phrase does. You’ll have to look at it from the extension’s user’s perspective. Is the phrase such that it’s reasonable to assume that someone might want to change it? Is it used only internally or is it supposed to be used directly by the author? Can the (internal) rules that use it be easily changed to use some other phrase instead?
For example, if you have:
To decide which number is the third power of (X - a number):
decide on X * X * X.
…then it’s very unlikely that someone would need to change the mathematical definition of a third power. They’ll more likely want to change rules to use some other phrase instead.
On the other hand if you have:
To tamper with a live wire:
now the fuse is blown;
end the story in death.
…then it’s very likely that someone might want something else to happen instead, so the phrase should be a named rule instead.
I don’t have Inform available to test, but if responses cannot be replaced in a phrase-as-named-rule, then that sounds like a bug that should be reported, no?
To do whatever (this is the doing whatever rule):
say "My custom text." (A)
There are other strings that can’t be assigned letters, either. Using Basic Screen Effects
center "[player's surroundings]" at row 1. (A)
won’t compile, even inside a named rule.
I don’t know if it amounts to a bug report or a feature request, but it seems like it’d make things more convenient to be able to label strings in other circumstances.
Thanks; that definitely seems like a bug, since a named phrase is a named rule (or, if it isn’t, the word “rule” should be dropped from the instruction that creates one).
I wouldn’t expect that example to compile, though, since the (A) is outside the rule terminator (i.e., the period).
This would certainly make things easier–then the game author could just replace the phrase if needed, and extension authors could use named phrases freely, even ones that they think game authors might want to modify.
It’s not quite the same. You don’t actually need the word ‘rule’ in there, I’m actually slightly surprised it’s allowed–in the documentation they’re usually named as participles.
To decide what number is twice (N - a number) (this is doubling):
decide on N + N.
It sounds like the “rule” should throw a compiler error when used with a named phrase. I think I learned of the ability to write “rule” there from some piece of official documentation and (if so) it was obviously misleading.
One thing not covered in the above discussion is that phrases can often be directly embedded in their I6 code, whereas rules always are compiled to separate I6 functions. So it will be slightly better performance to use phrases when the advantages of rules are not needed. If they are phrases involving block values the performance difference will be more noticeable. (Because I think the rule would have the overhead of initialising new block value local variables.)