What is it that I am doing wrong here? I have the following code to replace the immediately restart the VM rule with a rule that sets a flag before restarting:
((+ set data value +)–>1)(6,1); @restart;
-) instead of “Immediately Restart VM Rule” in “OrderOfPlay.i6t”.
To set data value (X - a number) to (Y - a number):
This produces the error:
I suspect that what’s going on is that Inform doesn’t recognize the set data value phrase at the time that it is being asked to replace the template layer. But even defining that phrase immediately before the instruction to replace the template layer section fails in the same way.
I should be able to do this, right? Would I be smarter just to replace the immediately restart the VM rule in the table of final questions with my own I7 rule and be done with it?
To make a phrase usable as a value, you need to name it:
((+ data-value setting +)-->1)(6,1);
-) instead of "Immediately Restart VM Rule" in "OrderOfPlay.i6t".
To set data value (X - a number) to (Y - a number) (this is data-value setting):
say "[X] to [Y]."
Eh? I learn this stuff from the Inform documentation in the first place, you know.
(Yes, I often look up stuff by searching the the Standard Rules, but that’s generally to find how to spell phrases that I know exist.)
Which trick are you asking about here? Naming a phrase to use it as a value is section 21.3. Including a chunk of I6 code to replace part of the standard templates is section 25.25. Hooking into an I6 routine with the “makes it so” definition is 25.23.
(I think I learned that from Dannii, or maybe EmacsUser.)
The direct answer to your question is that it’s not documented because it’s internal to the language implementation. (You are referring to the internal I6 structure of an I7-generated object, the closure block, and how to invoke this from I6 code.) It should not be in the I7 manual because you can’t get at it from I7 code at all.
There could be an “I7 technical manual”, analogous to the “I6 technical manual”, documenting all this implementation-layer stuff. That would be great, but Graham hasn’t written it. Maybe it will come out along with the I7 source code. Then again, it may be in the I7 source code, as comments. Or maybe he hasn’t written the comments yet, which would be one reason that the I7 source code isn’t out.