[I7] Person Mister X overrides Local Variable X

I had an idea for a small test command XALL. It’s not as universal as Juhana Leinonen’s Object Response Test, but it’s helped me make sure of what is described in my room, since “examine all” doesn’t work.

However, it ran into a very localized problem. Namely, in the code below, X (a local variable) is seen as a global.

Shouldn’t locals override globals? Or is there something about Inform I should know about, or should there be a warning? I’m aware that I can probably find better variable names, but all the same, there’s a variable name clash that’s resolved the opposite of what is expected. YALL works fine, but XALL examines Mister X.

Also, what’s the procedure for potentially reporting Inform bugs? What should I check before doing so (e.g. database of known/fixed bugs)? I’m a bit nervous about doing so, but all the same, I’d like to help, and just knowing something obscure is a compiler bug instead of my own fault helps me not get stuck.

[code]“mister-x” by andrew

Undescribed Glade is a room. Mister X is a person in Glade. flowers, trees, birds and bees are scenery in Glade.

instead of asking Mister X about: say “‘I’m just here as a disruptive example.’”

xalling is an action applying to nothing. understand the command “xall” as something new. understand “xall” as xalling.

carry out xalling:
repeat with X running through visible things:
say “[X]: [no line break]”;
try examining X;
the rule succeeds;

yalling is an action applying to nothing. understand the command “yall” as something new. understand “yall” as yalling.

carry out yalling:
repeat with y running through visible things:
say “[y]: [no line break]”;
try examining y;
the rule succeeds;[/code]

Thanks again!

I don’t have anything to say about the actual problem but just a side note that you can make “examine all” work by just adding this line:

Understand "examine [things]" as examining.

I believe Emily Short may have beaten you to it through the property checking extension.

That’s a good one and it helps avoid non-implementation–and I actually forgot I used it. I didn’t group it with Object Response Tests since I viewed it as more of a yes/no thing than a content verifier.

My main motivations for using this script are

  1. to be able to see all descriptions of items/things are in a room (I often implement an item and forget to put it where it’s supposed to be, and often I’ll want to see scenery/descriptions/etc.)
  2. to have an easy way to check if the descriptions have changed, say, after a puzzle

“Examine all” seems to work quite well, though, and since it’s not bad to change the description of “all,” I can adjust what I need to.

That still leaves the original problem, which is a bit more than intellectual curiosity. I have had variables clash, in examples other than examine, and while I may be able to write better code or use natural language better, this has gotten me confused a few times.

The site for reporting I7 bugs (and I6 bugs, too, these days) is inform7.com/mantis/ .

The procedure is roughly to go there, look around. Also post and ask if you’re not sure whether a given behavior is deliberate, buggy, or a weird corner case that’s hard to sort out. This could plausibly fall into the third category, but it turns out there’s already a filed bug that looks like the same root cause: inform7.com/mantis/view.php?id=956

That was originally filed for a collision between the global variable “player” and an object “player alice”. So it doesn’t seem to matter whether the variable is global or local.