Problem with using responses from phrase in 10.1?

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.)

1 Like

I’m sure I remember that working in the current released version of Inform…

I’ll double check, then. My installation may be out of date.

EDIT: This is on 10.1.2. Interpreter version 0.6.0 / VM 3.1.3. Is there a newer release that I missed?

Known bug in 10.1. I7-2353, fixed in current development release.

1 Like

I’m definitely using 10.1.2 as well and never ran into this, and I’m certain I had a few places where I said the response of another rule…

I7-2353 is not “all attempts to issue another rule’s response blow up”.

I reproduced Otis’ issue in 10.1.2.

I tried the same code in current dev, and it worked.

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. :wink:

Yes, the exact nature of the bug and when it occurs is regrettably murky, I’m afraid.

1 Like

@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.

2 Likes

How would you modify A, though?

The fooing response (A) is "Let's not [O].";

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.

That works as expected (in 6M62 at least).

1 Like

Huh. Didn’t know about that.

There’s an I6 array LocalParking which gets used as the transfer point.

The “set to arbitrary text” case doesn’t work, e.g this is an error:

	let T be "Really thinking of [randnum].";
	now the fooing rule response (A) is T;

But it’s no worse for phrases. So yeah, this may be doable.

1 Like