"understand when touchable" bug/hang in 6G and not 6L

This is something I have a suitable workaround for, but all the same, I’m wondering what is going on, and if people 1) know a quick solution or 2) can point me to how I would debug something like this in I6. Most of my I6 debugging has been capturing text that I don’t want to see, looking at *.i6t, and figuring what to do with the code. But I don’t know how to debug a hang!

"sandbox" by andrew schultz

objasking generically is an action applying to one visible thing. Understand "ask about [any thing]" or "talk about [any thing]" or "a [any thing]" as objasking generically.

understand "x" as blot when blot is touchable.
understand "x" as blog when blog is touchable.

definition: a thing (called q) is around:
	if q is enclosed by location of player, yes;

every turn:
	say "[whether or not blot is in location of player]";

r1 is a room.

bo is a person in r1.

r2 is east of r1.

bob is a person in r2.

the blot is a thing in r1.
the blog is a thing in r2.

carry out objasking generically:
	repeat through table of talk things:
		if noun is noun-match entry, say "[text entry]" instead;
	say "No matches for things.";

table of talk things
noun-match	text
blot	"blot..."
blog	"blog..."

The text above causes a hang in the 6G IDE for windows, but it’s okay in 6L. That’s largely related to the “touchable” definition. When I define something as “around,” it works fine, and that’s more than good enough for my purposes. The main thing I need to do is to allow for synonyms, but I don’t want two similarly-named things clashing or to have to rely on “does the player mean” too much.

  1. Is there a known fix for this?
  2. If there’s not a known fix, would there be a way for me to check any source control for Inform core code changes between the 6G and 6L release?
  3. If not, how would I begin to debug the I6 code?

Again, I have a workaround of defining a similar property to “touchable,” (or finally upgrading,) so this is intellectual curiosity. But it’s something that had popped up before, and I was finally able to pin it down, and it’s something I wasn’t able to answer on my own. Thanks!

When you check “X is touchable/untouchable”, you are doing a scope test. That is, the parser starts at the current location and iterates down through every object, being careful about open/closed containers, to see whether X is reachable.

The problem is that when the parser is checking names (the “Understand ‘x’ as … when…” rule), it’s already doing a scope iteration. I haven’t compared 6G60 with 6L02, but I imagine the earlier implementation uses global variables in an unsafe way. Trying to do one scope test inside another overwrites variables and causes an infinite loop.

I don’t recommend doing this at all. You don’t want a heavyweight test like that when parsing every object name in every command. Your definition of “around” is fine.

1 Like

Thanks! I actually was using “touchable” because I figured it’d cause less work for inform than “visible.”

But now that I know it’s still pretty complicated, I may look to modify other code that uses “touchable” and see if that saves time during my big test runs.

About the same amount of work.

1 Like