Is this a known bug? The following works fine in 6M62 but generates an RTE in 10.1:
This is the response container rule:
say "Alpha." (A);
say "Beta." (B).
To test cross rule response use:
say text of the response container rule response (A);
say line break.
When play begins:
test cross rule response use.
It seems like a compiler-level fault. The I6 call to the routine for printing responses isn’t being given any parameter, and it expects one. (The called value is decremented by 1 inside STANDARD_RESPONSE_ISSUING_R(), which is why the RTE complains about -1.)
My issue is that the error in I7-2353 doesn’t seem to accurately describe the conditions of the bug. As @Celtic_Minstrel points out, it is not the case that “just the existence of code writing to the rule response of a rule defined in I7 causes the blowup.” While it is true that this code fails at the i6 compilation stage:
Lab is a room.
to foo: now the standard report opening rule response (C) is "q".
The following compiles and works as expected:
Lab is a room.
instead of waiting:
now the standard report opening rule response (C) is "q";
carry out the issuing the response text activity with the standard report opening rule response (C).
Is it just the use of this syntax within a phrase that’s the issue? It would be nice to know what to avoid specifically. (I’m coincidentally working on an extension that makes use of this machinery.)
I appreciate the fact that this is fixed in the next build, but that’s not the one I’m using.
@Zed: An idea possibly worth promoting up the chain: Is there any chance of extending the responses system to phrases? The underlying architecture (in terms of generated I6) looks like it might be able to handle it without too much fuss, and I would expect that compiler code requirements are similar to whatever it’s doing while handling responses inside rules.
I’m thinking along the lines of allowing:
To foo (O - object), with optionality (this is fooing):
say "Let's foo [O]!" (A);
if optionality:
say "Optionality in effect." (B):
otherwise:
say "Optionality not in effect." (C).
That would let one refer to, use and/or modify fooing response (A), fooing response (B) and fooing response (C), for example.
The compiler would have to know that O is a local variable, and compile the text with that local reference. And then you can change a response to any text at runtime, which I don’t see how that would work at all.
I haven’t the faintest clue how the magic works, but it’s already handling something very similar for responses in rules:
This is the local variable rule:
let randnum be a random number between 1 and 100;
say "I'm thinking of [randnum]." (A).
When play begins:
now local variable rule response (A) is "Isn't [randnum] a nice number?";
follow the local variable rule.